From 7f500cd683a9c8def3042d76ca59daa42f0448ec Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 8 Apr 2025 08:10:38 +0900 Subject: [PATCH 1/3] MINOR: Fix JNI code after upstream DCHECK change --- dataset/src/main/cpp/jni_util.cc | 4 ++-- gandiva/src/main/cpp/expression_registry_helper.cc | 2 +- gandiva/src/main/cpp/jni_common.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dataset/src/main/cpp/jni_util.cc b/dataset/src/main/cpp/jni_util.cc index 1fd15696e6..35bfb328f0 100644 --- a/dataset/src/main/cpp/jni_util.cc +++ b/dataset/src/main/cpp/jni_util.cc @@ -187,7 +187,7 @@ ReservationListenableMemoryPool::~ReservationListenableMemoryPool() {} std::string Describe(JNIEnv* env, jthrowable t) { jclass describer_class = env->FindClass("org/apache/arrow/dataset/jni/JniExceptionDescriber"); - DCHECK_NE(describer_class, nullptr); + ARROW_DCHECK_NE(describer_class, nullptr); jmethodID describe_method = env->GetStaticMethodID( describer_class, "describe", "(Ljava/lang/Throwable;)Ljava/lang/String;"); std::string description = JStringToCString( @@ -197,7 +197,7 @@ std::string Describe(JNIEnv* env, jthrowable t) { bool IsErrorInstanceOf(JNIEnv* env, jthrowable t, std::string class_name) { jclass java_class = env->FindClass(class_name.c_str()); - DCHECK_NE(java_class, nullptr) << "Could not find Java class " << class_name; + ARROW_DCHECK_NE(java_class, nullptr) << "Could not find Java class " << class_name; return env->IsInstanceOf(t, java_class); } diff --git a/gandiva/src/main/cpp/expression_registry_helper.cc b/gandiva/src/main/cpp/expression_registry_helper.cc index 66b97c8b9e..21077ff1db 100644 --- a/gandiva/src/main/cpp/expression_registry_helper.cc +++ b/gandiva/src/main/cpp/expression_registry_helper.cc @@ -138,7 +138,7 @@ void ArrowToProtobuf(DataTypePtr type, gandiva::types::ExtGandivaType* gandiva_d default: // un-supported types. test ensures that // when one of these are added build breaks. - DCHECK(false); + ARROW_DCHECK(false); } } diff --git a/gandiva/src/main/cpp/jni_common.cc b/gandiva/src/main/cpp/jni_common.cc index ec1bb76234..2851250072 100644 --- a/gandiva/src/main/cpp/jni_common.cc +++ b/gandiva/src/main/cpp/jni_common.cc @@ -751,7 +751,7 @@ Status JavaResizableBuffer::Resize(const int64_t new_size, bool shrink_to_fit) { } RETURN_NOT_OK(Reserve(new_size)); - DCHECK_GE(capacity_, new_size); + ARROW_DCHECK_GE(capacity_, new_size); size_ = new_size; return Status::OK(); } From 7fe6afde03af75df5ed14a66f1cea495db5c35fd Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 8 Apr 2025 10:19:47 +0900 Subject: [PATCH 2/3] fix flatbuf --- .github/workflows/rc.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 5b78cc9395..86c1439ef3 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -261,6 +261,10 @@ jobs: # bundled Protobuf. brew uninstall protobuf + # We need Flatbuffers 24, not the latest version + brew uninstall flatbuffers || : + brew install flatbuffers@24.3.6 || : + brew bundle --file=Brewfile - name: Prepare ccache run: | From 78f23bad91d0e4dec257baec8fdc1b6eaae98d1b Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 8 Apr 2025 10:50:09 +0900 Subject: [PATCH 3/3] fix flatbuf (again) --- .github/workflows/rc.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 86c1439ef3..e039306ec3 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -262,8 +262,9 @@ jobs: brew uninstall protobuf # We need Flatbuffers 24, not the latest version - brew uninstall flatbuffers || : - brew install flatbuffers@24.3.6 || : + # Homebrew does not offer older versions, so remove the Homebrew + # package and rely on Arrow using a bundled version instead + brew uninstall flatbuffers brew bundle --file=Brewfile - name: Prepare ccache