This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 3ce5ff0 ARROW-8561: [C++][Gandiva] Stop using deprecated
google::protobuf::MessageLite::ByteSize()
3ce5ff0 is described below
commit 3ce5ff020b80f58f1f30acd2e6a6f6dff363a18f
Author: Sutou Kouhei <[email protected]>
AuthorDate: Wed Apr 22 18:28:00 2020 -0500
ARROW-8561: [C++][Gandiva] Stop using deprecated
google::protobuf::MessageLite::ByteSize()
ByteSize() is deprecated and ByteSizeLong() is added since Protobuf 3.4.0.
https://github.com/protocolbuffers/protobuf/blob/v3.4.0/CHANGES.txt#L58-L59
> * ByteSize() and SpaceUsed() are deprecated.Use ByteSizeLong() and
> SpaceUsedLong() instead
Closes #7016 from kou/cpp-protobuf-use-byte-size-long
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Wes McKinney <[email protected]>
---
cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 ++++
cpp/src/gandiva/jni/expression_registry_helper.cc | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index bfc2af9..1925a7a 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1225,6 +1225,10 @@ if(ARROW_WITH_PROTOBUF)
if(ARROW_WITH_GRPC)
# gRPC 1.21.0 or later require Protobuf 3.7.0 or later.
set(ARROW_PROTOBUF_REQUIRED_VERSION "3.7.0")
+ elseif(ARROW_GANDIVA_JAVA)
+ # google::protobuf::MessageLite::ByteSize() is deprecated since
+ # Protobuf 3.4.0.
+ set(ARROW_PROTOBUF_REQUIRED_VERSION "3.4.0")
else()
set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1")
endif()
diff --git a/cpp/src/gandiva/jni/expression_registry_helper.cc
b/cpp/src/gandiva/jni/expression_registry_helper.cc
index 5af075a..e150ec9 100644
--- a/cpp/src/gandiva/jni/expression_registry_helper.cc
+++ b/cpp/src/gandiva/jni/expression_registry_helper.cc
@@ -163,7 +163,7 @@
Java_org_apache_arrow_gandiva_evaluator_ExpressionRegistryJniHelper_getGandivaSu
types::ExtGandivaType* gandiva_data_type =
gandiva_data_types.add_datatype();
ArrowToProtobuf(type, gandiva_data_type);
}
- int size = gandiva_data_types.ByteSize();
+ auto size = gandiva_data_types.ByteSizeLong();
std::unique_ptr<jbyte[]> buffer{new jbyte[size]};
gandiva_data_types.SerializeToArray(reinterpret_cast<void*>(buffer.get()),
size);
jbyteArray ret = env->NewByteArray(size);
@@ -192,7 +192,7 @@
Java_org_apache_arrow_gandiva_evaluator_ExpressionRegistryJniHelper_getGandivaSu
ArrowToProtobuf(param_type, proto_param_type);
}
}
- int size = gandiva_functions.ByteSize();
+ auto size = gandiva_functions.ByteSizeLong();
std::unique_ptr<jbyte[]> buffer{new jbyte[size]};
gandiva_functions.SerializeToArray(reinterpret_cast<void*>(buffer.get()),
size);
jbyteArray ret = env->NewByteArray(size);