From e6b90aec0ffa9a7382427d6fe54227d60f6bd9cc Mon Sep 17 00:00:00 2001 From: Kaleb S. KEITHLEY Date: Mar 20 2024 12:32:32 +0000 Subject: rhbz#2269811, fix ABI break partial revert of https://github.com/apache/arrow/pull/39866 Signed-off-by: Kaleb S. KEITHLEY --- diff --git a/0002-cpp-src-arrow-util-key_value_metadata.patch b/0002-cpp-src-arrow-util-key_value_metadata.patch new file mode 100644 index 0000000..e9bf3b5 --- /dev/null +++ b/0002-cpp-src-arrow-util-key_value_metadata.patch @@ -0,0 +1,92 @@ +--- apache-arrow-15.0.2/cpp/src/arrow/util/key_value_metadata.h.orig 2024-03-13 09:37:59.000000000 -0400 ++++ apache-arrow-15.0.2/cpp/src/arrow/util/key_value_metadata.h 2024-03-20 08:02:01.157830922 -0400 +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -45,13 +44,13 @@ + void ToUnorderedMap(std::unordered_map* out) const; + void Append(std::string key, std::string value); + +- Result Get(std::string_view key) const; +- bool Contains(std::string_view key) const; ++ Result Get(const std::string& key) const; ++ bool Contains(const std::string& key) const; + // Note that deleting may invalidate known indices +- Status Delete(std::string_view key); ++ Status Delete(const std::string& key); + Status Delete(int64_t index); + Status DeleteMany(std::vector indices); +- Status Set(std::string key, std::string value); ++ Status Set(const std::string& key, const std::string& value); + + void reserve(int64_t n); + +@@ -64,7 +63,7 @@ + std::vector> sorted_pairs() const; + + /// \brief Perform linear search for key, returning -1 if not found +- int FindKey(std::string_view key) const; ++ int FindKey(const std::string& key) const; + + std::shared_ptr Copy() const; + +--- apache-arrow-15.0.2/cpp/src/arrow/util/key_value_metadata.cc.orig 2024-03-13 09:37:59.000000000 -0400 ++++ apache-arrow-15.0.2/cpp/src/arrow/util/key_value_metadata.cc 2024-03-20 08:02:01.156830941 -0400 +@@ -90,7 +90,7 @@ + values_.push_back(std::move(value)); + } + +-Result KeyValueMetadata::Get(std::string_view key) const { ++Result KeyValueMetadata::Get(const std::string& key) const { + auto index = FindKey(key); + if (index < 0) { + return Status::KeyError(key); +@@ -129,7 +129,7 @@ + return Status::OK(); + } + +-Status KeyValueMetadata::Delete(std::string_view key) { ++Status KeyValueMetadata::Delete(const std::string& key) { + auto index = FindKey(key); + if (index < 0) { + return Status::KeyError(key); +@@ -138,18 +138,20 @@ + } + } + +-Status KeyValueMetadata::Set(std::string key, std::string value) { ++Status KeyValueMetadata::Set(const std::string& key, const std::string& value) { + auto index = FindKey(key); + if (index < 0) { +- Append(std::move(key), std::move(value)); ++ Append(key, value); + } else { +- keys_[index] = std::move(key); +- values_[index] = std::move(value); ++ keys_[index] = key; ++ values_[index] = value; + } + return Status::OK(); + } + +-bool KeyValueMetadata::Contains(std::string_view key) const { return FindKey(key) >= 0; } ++bool KeyValueMetadata::Contains(const std::string& key) const { ++ return FindKey(key) >= 0; ++} + + void KeyValueMetadata::reserve(int64_t n) { + DCHECK_GE(n, 0); +@@ -186,7 +188,7 @@ + return pairs; + } + +-int KeyValueMetadata::FindKey(std::string_view key) const { ++int KeyValueMetadata::FindKey(const std::string& key) const { + for (size_t i = 0; i < keys_.size(); ++i) { + if (keys_[i] == key) { + return static_cast(i); diff --git a/libarrow.spec b/libarrow.spec index 37dd44f..7d33fdc 100644 --- a/libarrow.spec +++ b/libarrow.spec @@ -31,13 +31,14 @@ Name: libarrow Version: 15.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A toolbox for accelerated data interchange and in-memory processing License: Apache-2.0 URL: https://arrow.apache.org/ Requires: %{name}-doc = %{version}-%{release} Source0: https://dist.apache.org/repos/dist/release/arrow/arrow-%{version}/apache-arrow-%{version}.tar.gz Patch0001: 0001-python-pyproject.toml.patch +Patch0002: 0002-cpp-src-arrow-util-key_value_metadata.patch # Apache ORC (liborc) has numerous compile errors and apparently assumes # a 64-bit build and runtime environment. This is only consumer of the liborc @@ -872,6 +873,10 @@ export LD_LIBRARY_PATH='%{buildroot}%{_libdir}' #-------------------------------------------------------------------- %changelog +* Wed Mar 20 2024 Kaleb S. KEITHLEY - 15.0.2-2 +- rhbz#2269811, fix ABI break +- partial revert of https://github.com/apache/arrow/pull/39866 + * Tue Mar 19 2024 Kaleb S. KEITHLEY - 15.0.2-1 - Arrow 15.0.2 GA - Note: The ABI break reported https://github.com/apache/arrow/issues/40604