From f91639b4a0b436739bc2de36e7a0dff37c08521c Mon Sep 17 00:00:00 2001 From: panbingkun Date: Fri, 22 Dec 2023 23:17:58 +0800 Subject: [PATCH] GH-39265: [Java] Make it run well with the netty newest version 4.1.104 (#39266) When I used `netty arrow memory 14.0.1` and `netty 4.1.104.Final` in Spark, the following error occurred, After pr: https://github.com/netty/netty/pull/13613, `PoolArena` no longer extends `SizeClasses`, but instead uses it as one of its fields, as follows: image in order to ensure that `netty arrow memory 14.0.1` works well with `netty 4.1.104.Final` version, I suggest making similar modifications here. 1.Compilation errors are as follows: https://github.com/panbingkun/spark/actions/runs/7237466030/job/19717162391 image 2.Some bugs have been fixed in `netty 4.1.104.Final` as follows: image image 4.1.104.Final release note: https://netty.io/news/2023/12/15/4-1-104-Final.html 4.1.103.Final release note: https://netty.io/news/2023/12/13/4-1-103-Final.html 4.1.101.Final release note: https://netty.io/news/2023/11/09/4-1-101-Final.html Java * Closes: #39265 Authored-by: panbingkun Signed-off-by: David Li --- java/gandiva/src/main/cpp/jni_common.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/java/gandiva/src/main/cpp/jni_common.cc b/java/gandiva/src/main/cpp/jni_common.cc index d815fc7c792a4..f341cb73f65ea 100644 --- a/java/gandiva/src/main/cpp/jni_common.cc +++ b/java/gandiva/src/main/cpp/jni_common.cc @@ -261,7 +261,6 @@ DataTypePtr ProtoTypeToList(const types::ExtGandivaType& ext_type) { DataTypePtr SimpleProtoTypeToDataType(const types::GandivaType& gandiva_type) { switch (gandiva_type) { case types::NONE: ->>>>>>> a225426e1 (DX-64328 Array types for Gandiva (#58)) return arrow::null(); case gandiva::types::BOOL: return arrow::boolean(); @@ -295,9 +294,9 @@ DataTypePtr SimpleProtoTypeToDataType(const types::GandivaType& gandiva_type) { return arrow::date32(); case gandiva::types::DATE64: return arrow::date64(); -<<<<<<< HEAD case gandiva::types::DECIMAL: -======= + // TODO: error handling + return arrow::decimal(ext_type.precision(), ext_type.scale()); default: std::cerr << "Unknown data type: " << gandiva_type << "\n"; return nullptr; @@ -309,7 +308,6 @@ DataTypePtr SimpleProtoTypeToDataType(const types::GandivaType& gandiva_type) { DataTypePtr ProtoTypeToDataType(const types::ExtGandivaType& ext_type) { switch (ext_type.type()) { case types::DECIMAL: ->>>>>>> a225426e1 (DX-64328 Array types for Gandiva (#58)) // TODO: error handling return arrow::decimal(ext_type.precision(), ext_type.scale()); case gandiva::types::TIME32: @@ -320,21 +318,13 @@ DataTypePtr ProtoTypeToDataType(const types::ExtGandivaType& ext_type) { return ProtoTypeToTimestamp(ext_type); case gandiva::types::INTERVAL: return ProtoTypeToInterval(ext_type); -<<<<<<< HEAD - case gandiva::types::FIXED_SIZE_BINARY: case gandiva::types::LIST: + return ProtoTypeToList(ext_type); + case gandiva::types::FIXED_SIZE_BINARY: case gandiva::types::STRUCT: case gandiva::types::UNION: case gandiva::types::DICTIONARY: case gandiva::types::MAP: -======= - case types::LIST: - return ProtoTypeToList(ext_type); - case types::FIXED_SIZE_BINARY: - case types::UNION: - case types::DICTIONARY: - case types::MAP: ->>>>>>> a225426e1 (DX-64328 Array types for Gandiva (#58)) std::cerr << "Unhandled data type: " << ext_type.type() << "\n"; return nullptr; default: