From 4b8ac81b0bc26208fd63561a1c61370469111b94 Mon Sep 17 00:00:00 2001 From: Ping Liu Date: Thu, 10 Sep 2026 15:50:50 +0800 Subject: [PATCH 01/12] restore the vendored iceberg::expected backport Co-authored-by: Junwang Zhao --- .github/.licenserc.yaml | 1 + LICENSE | 28 + src/iceberg/expected.h | 2359 +++++++++++++++++++++++++++++ src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/expected_test.cc | 636 ++++++++ 5 files changed, 3025 insertions(+) create mode 100644 src/iceberg/expected.h create mode 100644 src/iceberg/test/expected_test.cc diff --git a/.github/.licenserc.yaml b/.github/.licenserc.yaml index a667c903e..dcfcd64f6 100644 --- a/.github/.licenserc.yaml +++ b/.github/.licenserc.yaml @@ -29,6 +29,7 @@ header: - 'LICENSE' - 'NOTICE' - 'requirements.txt' + - 'src/iceberg/expected.h' - 'src/iceberg/util/murmurhash3_internal.*' - 'src/iceberg/test/resources/**' - 'src/iceberg/catalog/hive/gen-cpp/**' diff --git a/LICENSE b/LICENSE index d0429e24b..6d0d88e91 100644 --- a/LICENSE +++ b/LICENSE @@ -230,6 +230,34 @@ License: https://www.apache.org/licenses/LICENSE-2.0 -------------------------------------------------------------------------------- +This product includes code from zeus-cpp/expected. + +* src/iceberg/expected.h is adapted from zeus-cpp/expected. + +Copyright: 2024 zeus-cpp. +Home page: https://github.com/zeus-cpp/expected +License: MIT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------------------------------------------------------------------- + This product bundles utf8proc, which is available under the MIT License: utf8proc is a software package originally developed by Jan Behrens and the rest diff --git a/src/iceberg/expected.h b/src/iceberg/expected.h new file mode 100644 index 000000000..c4ce4c240 --- /dev/null +++ b/src/iceberg/expected.h @@ -0,0 +1,2359 @@ +/* + * MIT License + * + * Copyright (c) 2024 zeus-cpp + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#pragma once + +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" + +// NOLINTBEGIN + +namespace iceberg { + +namespace expected_detail { + +template class Template> +inline constexpr bool is_specialization_v = + false; // true if and only if T is a specialization of Template +template