diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index da2ac828f8..406e33d707 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -125,12 +125,12 @@ jobs: wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb sudo apt update - sudo apt install -y libarrow-dev=14.0.1-1 \ - libarrow-dataset-dev=14.0.1-1 \ - libarrow-acero-dev=14.0.1-1 \ - libarrow-flight-dev=14.0.1-1 \ - libgandiva-dev=14.0.1-1 \ - libparquet-dev=14.0.1-1 + sudo apt install -y libarrow-dev \ + libarrow-dataset-dev \ + libarrow-acero-dev \ + libarrow-flight-dev \ + libgandiva-dev \ + libparquet-dev # install deps for java sudo apt install -y default-jdk-headless maven diff --git a/modules/io/io/io_factory.cc b/modules/io/io/io_factory.cc index e48e682080..c5bc2fe903 100644 --- a/modules/io/io/io_factory.cc +++ b/modules/io/io/io_factory.cc @@ -29,6 +29,7 @@ limitations under the License. #include "arrow/api.h" #include "arrow/io/api.h" +#include "arrow/util/config.h" #include "arrow/util/uri.h" #include "boost/algorithm/string.hpp" @@ -72,9 +73,14 @@ std::unique_ptr IOFactory::CreateIOAdaptor( } // If there are non-ascii characters, we shall pre-encode the location, // as the arrow::internal::Uri will fail. +#if defined(ARROW_VERSION) && ARROW_VERSION >= 16000000 + auto encoded_location = location_to_parse.substr(0, i) + + arrow::util::UriEscape(location_to_parse.substr(i)); +#else auto encoded_location = location_to_parse.substr(0, i) + arrow::internal::UriEscape(location_to_parse.substr(i)); +#endif arrow::internal::Uri uri; { auto s = uri.Parse(encoded_location); @@ -100,8 +106,13 @@ std::unique_ptr IOFactory::CreateIOAdaptor( // Note we should not encode the leading '/' if there is one, // cause arrow::internal::Uri requires the path must be an absolute path. location_to_parse = std::string(resolved_path); +#if defined(ARROW_VERSION) && ARROW_VERSION >= 16000000 + auto s = uri.Parse("file:///" + + arrow::util::UriEscape(location_to_parse.substr(1))); +#else auto s = uri.Parse( "file:///" + arrow::internal::UriEscape(location_to_parse.substr(1))); +#endif if (!s.ok()) { LOG(ERROR) << "Failed to detect the scheme of given location " << location; diff --git a/modules/io/io/local_io_adaptor.cc b/modules/io/io/local_io_adaptor.cc index d63583dd91..09334fa51b 100644 --- a/modules/io/io/local_io_adaptor.cc +++ b/modules/io/io/local_io_adaptor.cc @@ -29,6 +29,7 @@ limitations under the License. #include "arrow/csv/api.h" #include "arrow/filesystem/api.h" #include "arrow/io/api.h" +#include "arrow/util/config.h" #include "arrow/util/uri.h" #include "boost/algorithm/string.hpp" @@ -103,8 +104,13 @@ LocalIOAdaptor::LocalIOAdaptor(const std::string& location) break; } } +#if defined(ARROW_VERSION) && ARROW_VERSION >= 16000000 + auto encoded_location = + location_.substr(0, i) + arrow::util::UriEscape(location_.substr(i)); +#else auto encoded_location = location_.substr(0, i) + arrow::internal::UriEscape(location_.substr(i)); +#endif fs_ = arrow::fs::FileSystemFromUriOrPath(encoded_location, &location_) .ValueOrDie(); #if defined(ARROW_VERSION) && ARROW_VERSION >= 3000000