This is an automated email from the ASF dual-hosted git repository.

HuaHuaY pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new ab171b294d8 GH-51245: [C++][Parquet][FOLLOWUP] Add support for LLVM 
23.1 (#51468)
ab171b294d8 is described below

commit ab171b294d8bfde02254ec0d50dc7afcc32a5416
Author: Zehua Zou <[email protected]>
AuthorDate: Wed Sep 23 18:52:15 2026 +0800

    GH-51245: [C++][Parquet][FOLLOWUP] Add support for LLVM 23.1 (#51468)
    
    ### Rationale for this change
    
    Add support for LLVM 23.1.
    
    My mistake. In the previous PR, I used the `ninja-debug-gandiva` CMake 
preset but didn't notice that some Parquet tests weren't being compiled; 
consequently, certain compilation errors within the Parquet component went 
undetected. This time I used the `ninja-debug` preset. I'm not sure if there 
are compilation errors in other presets—I don't use them often, and CI doesn't 
check them either—so we'll just fix them if we run into them.
    
    ### What changes are included in this PR?
    
    Remove static from some template functions in header files because LLVM 23 
added `-Wunused-template` to `-Wall`.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    
    ### Was AI used for this PR?
    
    In accordance to the [AI generation 
guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code),
 please disclose below whether and how AI was used in this PR.
    
    **PR code and description written by:**
    
    - [x] Human
    - [ ] AI
    
    **Reviewed before submission by:**
    
    - [x] Human
    - [ ] AI
    - [ ] Not reviewed
    
    * GitHub Issue: #51245
    
    Authored-by: Zehua Zou <[email protected]>
    Signed-off-by: Zehua Zou <[email protected]>
---
 cpp/src/parquet/arrow/test_util.h     |  2 +-
 cpp/src/parquet/column_reader_test.cc | 32 ----------------
 cpp/src/parquet/test_util.h           | 69 ++++++++++++++++-------------------
 3 files changed, 32 insertions(+), 71 deletions(-)

diff --git a/cpp/src/parquet/arrow/test_util.h 
b/cpp/src/parquet/arrow/test_util.h
index 05f6fd24ac0..2c23e7162be 100644
--- a/cpp/src/parquet/arrow/test_util.h
+++ b/cpp/src/parquet/arrow/test_util.h
@@ -141,7 +141,7 @@ template <typename ArrowType>
 }
 
 template <int32_t byte_width>
-static void random_decimals(int64_t n, uint32_t seed, int32_t precision, 
uint8_t* out) {
+void random_decimals(int64_t n, uint32_t seed, int32_t precision, uint8_t* 
out) {
   auto gen = ::arrow::random::RandomArrayGenerator(seed);
   std::shared_ptr<Array> decimals;
   if constexpr (byte_width == 4) {
diff --git a/cpp/src/parquet/column_reader_test.cc 
b/cpp/src/parquet/column_reader_test.cc
index 87514d87db6..e042f6f1d4d 100644
--- a/cpp/src/parquet/column_reader_test.cc
+++ b/cpp/src/parquet/column_reader_test.cc
@@ -48,38 +48,6 @@ using testing::ElementsAre;
 
 namespace test {
 
-template <typename T>
-static inline bool vector_equal_with_def_levels(const std::vector<T>& left,
-                                                const std::vector<int16_t>& 
def_levels,
-                                                int16_t max_def_levels,
-                                                int16_t max_rep_levels,
-                                                const std::vector<T>& right) {
-  size_t i_left = 0;
-  size_t i_right = 0;
-  for (size_t i = 0; i < def_levels.size(); i++) {
-    if (def_levels[i] == max_def_levels) {
-      // Compare
-      if (left[i_left] != right[i_right]) {
-        std::cerr << "index " << i << " left was " << left[i_left] << " right 
was "
-                  << right[i] << std::endl;
-        return false;
-      }
-      i_left++;
-      i_right++;
-    } else if (def_levels[i] == (max_def_levels - 1)) {
-      // Null entry on the lowest nested level
-      i_right++;
-    } else if (def_levels[i] < (max_def_levels - 1)) {
-      // Null entry on a higher nesting level, only supported for 
non-repeating data
-      if (max_rep_levels == 0) {
-        i_right++;
-      }
-    }
-  }
-
-  return true;
-}
-
 class TestPrimitiveReader : public ::testing::Test {
  public:
   void InitReader(const ColumnDescriptor* d) {
diff --git a/cpp/src/parquet/test_util.h b/cpp/src/parquet/test_util.h
index 9271dc290ca..0e1199378b6 100644
--- a/cpp/src/parquet/test_util.h
+++ b/cpp/src/parquet/test_util.h
@@ -76,8 +76,7 @@ std::string get_bad_data_dir();
 std::string get_data_file(const std::string& filename, bool is_good = true);
 
 template <typename T>
-static inline void assert_vector_equal(const std::vector<T>& left,
-                                       const std::vector<T>& right) {
+inline void assert_vector_equal(const std::vector<T>& left, const 
std::vector<T>& right) {
   ASSERT_EQ(left.size(), right.size());
 
   for (size_t i = 0; i < left.size(); ++i) {
@@ -86,7 +85,7 @@ static inline void assert_vector_equal(const std::vector<T>& 
left,
 }
 
 template <typename T>
-static inline bool vector_equal(const std::vector<T>& left, const 
std::vector<T>& right) {
+inline bool vector_equal(const std::vector<T>& left, const std::vector<T>& 
right) {
   if (left.size() != right.size()) {
     return false;
   }
@@ -103,7 +102,7 @@ static inline bool vector_equal(const std::vector<T>& left, 
const std::vector<T>
 }
 
 template <typename T>
-static std::vector<T> slice(const std::vector<T>& values, int start, int end) {
+std::vector<T> slice(const std::vector<T>& values, int start, int end) {
   if (end < start) {
     return std::vector<T>(0);
   }
@@ -176,21 +175,20 @@ std::shared_ptr<Buffer> EncodeValues(Encoding::type 
encoding, bool use_dictionar
 }
 
 template <typename T>
-static void InitValues(int num_values, uint32_t seed, std::vector<T>& values,
-                       std::vector<uint8_t>& buffer) {
+void InitValues(int num_values, uint32_t seed, std::vector<T>& values,
+                std::vector<uint8_t>& buffer) {
   random_numbers(num_values, seed, std::numeric_limits<T>::min(),
                  std::numeric_limits<T>::max(), values.data());
 }
 
 template <typename T>
-static void InitValues(int num_values, std::vector<T>& values,
-                       std::vector<uint8_t>& buffer) {
+void InitValues(int num_values, std::vector<T>& values, std::vector<uint8_t>& 
buffer) {
   InitValues(num_values, 0, values, buffer);
 }
 
 template <typename T>
-static void InitDictValues(int num_values, int num_dicts, std::vector<T>& 
values,
-                           std::vector<uint8_t>& buffer) {
+void InitDictValues(int num_values, int num_dicts, std::vector<T>& values,
+                    std::vector<uint8_t>& buffer) {
   int repeat_factor = num_values / num_dicts;
   InitValues<T>(num_dicts, values, buffer);
   // add some repeated values
@@ -347,7 +345,7 @@ inline void 
DataPageBuilder<BooleanType>::AppendValues(const ColumnDescriptor* d
 }
 
 template <typename Type>
-static std::shared_ptr<DataPageV1> MakeDataPage(
+std::shared_ptr<DataPageV1> MakeDataPage(
     const ColumnDescriptor* d, const std::vector<typename Type::c_type>& 
values,
     int num_vals, Encoding::type encoding, const uint8_t* indices, int 
indices_size,
     const std::vector<int16_t>& def_levels, int16_t max_def_level,
@@ -441,7 +439,7 @@ inline std::shared_ptr<Buffer> 
DictionaryPageBuilder<BooleanType>::AppendValues(
 }
 
 template <typename Type>
-inline static std::shared_ptr<DictionaryPage> MakeDictPage(
+inline std::shared_ptr<DictionaryPage> MakeDictPage(
     const ColumnDescriptor* d, const std::vector<typename Type::c_type>& 
values,
     const std::vector<int>& values_per_page, Encoding::type encoding,
     std::vector<std::shared_ptr<Buffer>>& rle_indices) {
@@ -463,15 +461,13 @@ inline static std::shared_ptr<DictionaryPage> 
MakeDictPage(
 
 // Given def/rep levels and values create multiple dict pages
 template <typename Type>
-inline static void PaginateDict(const ColumnDescriptor* d,
-                                const std::vector<typename Type::c_type>& 
values,
-                                const std::vector<int16_t>& def_levels,
-                                int16_t max_def_level,
-                                const std::vector<int16_t>& rep_levels,
-                                int16_t max_rep_level, int num_levels_per_page,
-                                const std::vector<int>& values_per_page,
-                                std::vector<std::shared_ptr<Page>>& pages,
-                                Encoding::type encoding = 
Encoding::RLE_DICTIONARY) {
+inline void PaginateDict(const ColumnDescriptor* d,
+                         const std::vector<typename Type::c_type>& values,
+                         const std::vector<int16_t>& def_levels, int16_t 
max_def_level,
+                         const std::vector<int16_t>& rep_levels, int16_t 
max_rep_level,
+                         int num_levels_per_page, const std::vector<int>& 
values_per_page,
+                         std::vector<std::shared_ptr<Page>>& pages,
+                         Encoding::type encoding = Encoding::RLE_DICTIONARY) {
   int num_pages = static_cast<int>(values_per_page.size());
   std::vector<std::shared_ptr<Buffer>> rle_indices;
   std::shared_ptr<DictionaryPage> dict_page =
@@ -501,15 +497,14 @@ inline static void PaginateDict(const ColumnDescriptor* d,
 
 // Given def/rep levels and values create multiple plain pages
 template <typename Type>
-static inline void PaginatePlain(const ColumnDescriptor* d,
-                                 const std::vector<typename Type::c_type>& 
values,
-                                 const std::vector<int16_t>& def_levels,
-                                 int16_t max_def_level,
-                                 const std::vector<int16_t>& rep_levels,
-                                 int16_t max_rep_level, int 
num_levels_per_page,
-                                 const std::vector<int>& values_per_page,
-                                 std::vector<std::shared_ptr<Page>>& pages,
-                                 Encoding::type encoding = Encoding::PLAIN) {
+inline void PaginatePlain(const ColumnDescriptor* d,
+                          const std::vector<typename Type::c_type>& values,
+                          const std::vector<int16_t>& def_levels, int16_t 
max_def_level,
+                          const std::vector<int16_t>& rep_levels, int16_t 
max_rep_level,
+                          int num_levels_per_page,
+                          const std::vector<int>& values_per_page,
+                          std::vector<std::shared_ptr<Page>>& pages,
+                          Encoding::type encoding = Encoding::PLAIN) {
   int num_pages = static_cast<int>(values_per_page.size());
   int def_level_start = 0;
   int def_level_end = 0;
@@ -537,14 +532,12 @@ static inline void PaginatePlain(const ColumnDescriptor* 
d,
 
 // Generates pages from randomly generated data
 template <typename Type>
-static inline int MakePages(const ColumnDescriptor* d, int num_pages, int 
levels_per_page,
-                            std::vector<int16_t>& def_levels,
-                            std::vector<int16_t>& rep_levels,
-                            std::vector<typename Type::c_type>& values,
-                            std::vector<uint8_t>& buffer,
-                            std::vector<std::shared_ptr<Page>>& pages,
-                            Encoding::type encoding = Encoding::PLAIN,
-                            uint32_t seed = 0) {
+inline int MakePages(const ColumnDescriptor* d, int num_pages, int 
levels_per_page,
+                     std::vector<int16_t>& def_levels, std::vector<int16_t>& 
rep_levels,
+                     std::vector<typename Type::c_type>& values,
+                     std::vector<uint8_t>& buffer,
+                     std::vector<std::shared_ptr<Page>>& pages,
+                     Encoding::type encoding = Encoding::PLAIN, uint32_t seed 
= 0) {
   int num_levels = levels_per_page * num_pages;
   int num_values = 0;
   int16_t zero = 0;

Reply via email to