From 5ae2764ffb2c7c26b5df042519e083f13062af76 Mon Sep 17 00:00:00 2001 From: Yue Ni Date: Tue, 14 Nov 2023 09:33:01 +0800 Subject: [PATCH 1/3] Use arrow io util to replace std::filesystem::path in gandiva test_util so that AlmaLinux 8 won't complain. --- cpp/src/gandiva/tests/test_util.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cpp/src/gandiva/tests/test_util.cc b/cpp/src/gandiva/tests/test_util.cc index 42f67d3824a..84c32f57cbe 100644 --- a/cpp/src/gandiva/tests/test_util.cc +++ b/cpp/src/gandiva/tests/test_util.cc @@ -17,12 +17,12 @@ #include "gandiva/tests/test_util.h" -#include +#include "arrow/util/io_util.h" +#include "arrow/util/logging.h" namespace gandiva { std::shared_ptr TestConfiguration() { - auto builder = ConfigurationBuilder(); - return builder.DefaultConfiguration(); + return ConfigurationBuilder::DefaultConfiguration(); } #ifndef GANDIVA_EXTENSION_TEST_DIR @@ -30,9 +30,10 @@ std::shared_ptr TestConfiguration() { #endif std::string GetTestFunctionLLVMIRPath() { - std::filesystem::path base(GANDIVA_EXTENSION_TEST_DIR); - std::filesystem::path ir_file = base / "multiply_by_two.bc"; - return ir_file.string(); + const auto base = + arrow::internal::PlatformFilename::FromString(GANDIVA_EXTENSION_TEST_DIR); + DCHECK(base.ok()); + return base->Join("multiply_by_two.bc")->ToString(); } NativeFunction GetTestExternalFunction() { From 479cae94b8f81cd2ef9c500794a4c273e32a96f3 Mon Sep 17 00:00:00 2001 From: Yue Date: Wed, 15 Nov 2023 22:44:29 +0800 Subject: [PATCH 2/3] update test_util.cc Co-authored-by: Antoine Pitrou --- cpp/src/gandiva/tests/test_util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/gandiva/tests/test_util.cc b/cpp/src/gandiva/tests/test_util.cc index 84c32f57cbe..efd39e1e662 100644 --- a/cpp/src/gandiva/tests/test_util.cc +++ b/cpp/src/gandiva/tests/test_util.cc @@ -32,7 +32,7 @@ std::shared_ptr TestConfiguration() { std::string GetTestFunctionLLVMIRPath() { const auto base = arrow::internal::PlatformFilename::FromString(GANDIVA_EXTENSION_TEST_DIR); - DCHECK(base.ok()); + DCHECK_OK(base); return base->Join("multiply_by_two.bc")->ToString(); } From 72832998b8f5d06485ad85686750ec976905fa0d Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 15 Nov 2023 16:06:38 +0100 Subject: [PATCH 3/3] Fix suggestion --- cpp/src/gandiva/tests/test_util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/gandiva/tests/test_util.cc b/cpp/src/gandiva/tests/test_util.cc index efd39e1e662..4a0a15c7223 100644 --- a/cpp/src/gandiva/tests/test_util.cc +++ b/cpp/src/gandiva/tests/test_util.cc @@ -32,7 +32,7 @@ std::shared_ptr TestConfiguration() { std::string GetTestFunctionLLVMIRPath() { const auto base = arrow::internal::PlatformFilename::FromString(GANDIVA_EXTENSION_TEST_DIR); - DCHECK_OK(base); + DCHECK_OK(base.status()); return base->Join("multiply_by_two.bc")->ToString(); }