diff --git a/cpp/src/arrow/util/macros.h b/cpp/src/arrow/util/macros.h index 1d23e829d74a9..d80828869b33c 100644 --- a/cpp/src/arrow/util/macros.h +++ b/cpp/src/arrow/util/macros.h @@ -36,28 +36,74 @@ TypeName& operator=(TypeName&&) = default #endif -#define ARROW_UNUSED(x) (void)(x) -#define ARROW_ARG_UNUSED(x) +// With ARROW_PREDICT_FALSE, GCC and clang can be told that a certain branch is +// not likely to be taken (for instance, a CHECK failure), and use that information in +// static analysis. Giving the compiler this information can affect the generated code +// layout in the absence of better information (i.e. -fprofile-arcs). [1] explains how +// this feature can be used to improve code generation. It was written as a positive +// comment to a negative article about the use of these annotations. // -// GCC can be told that a certain branch is not likely to be taken (for -// instance, a CHECK failure), and use that information in static analysis. -// Giving it this information can help it optimize for the common case in -// the absence of better information (ie. -fprofile-arcs). +// ARROW_COMPILER_ASSUME allows the compiler to assume that a given expression is +// true, without evaluating it, and to optimise based on this assumption [2]. If this +// condition is violated at runtime, the behavior is undefined. This can be useful to +// generate both faster and smaller code in compute kernels. // -#if defined(__GNUC__) -#define ARROW_PREDICT_FALSE(x) (__builtin_expect(!!(x), 0)) -#define ARROW_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) +// IMPORTANT: Different optimisers are likely to react differently to this annotation! +// It should be used with care when we can prove by some means that the assumption +// is (1) guaranteed to always hold and (2) is useful for optimization [3]. If the +// assumption is pessimistic, it might even block the compiler from decisions that +// could lead to better code [4]. If you have a good intuition for what the compiler +// can do with assumptions [5], you can use this macro to guide it and end up with +// results you would only get with more complex code transformations. +// `clang -S -emit-llvm` can be used to check how the generated code changes with +// your specific use of this macro. +// +// [1] https://lobste.rs/s/uwgtkt/don_t_use_likely_unlikely_attributes#c_xi3wmc +// [2] "Portable assumptions" +// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1774r4.pdf +// [3] "Assertions Are Pessimistic, Assumptions Are Optimistic" +// https://blog.regehr.org/archives/1096 +// [4] https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609 +// [5] J. Doerfert et al. 2019. "Performance Exploration Through Optimistic Static +// Program Annotations". https://github.com/jdoerfert/PETOSPA/blob/master/ISC19.pdf +#define ARROW_UNUSED(x) (void)(x) +#define ARROW_ARG_UNUSED(x) +#if defined(__GNUC__) // GCC and compatible compilers (clang, Intel ICC) #define ARROW_NORETURN __attribute__((noreturn)) #define ARROW_NOINLINE __attribute__((noinline)) #define ARROW_FORCE_INLINE __attribute__((always_inline)) +#define ARROW_PREDICT_FALSE(x) (__builtin_expect(!!(x), 0)) +#define ARROW_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) #define ARROW_PREFETCH(addr) __builtin_prefetch(addr) -#elif defined(_MSC_VER) +#define ARROW_RESTRICT __restrict +#if defined(__clang__) // clang-specific +#define ARROW_COMPILER_ASSUME(expr) __builtin_assume(expr) +#else // GCC-specific +#if __GNUC__ >= 13 +#define ARROW_COMPILER_ASSUME(expr) __attribute__((assume(expr))) +#else +// GCC does not have a built-in assume intrinsic before GCC 13, so we use an +// if statement and __builtin_unreachable() to achieve the same effect [2]. +// Unlike clang's __builtin_assume and C++23's [[assume(expr)]], using this +// on GCC won't warn about side-effects in the expression, so make sure expr +// is side-effect free when working with GCC versions before 13 (Jan-2024), +// otherwise clang/MSVC builds will fail in CI. +#define ARROW_COMPILER_ASSUME(expr) \ + if (expr) { \ + } else { \ + __builtin_unreachable(); \ + } +#endif // __GNUC__ >= 13 +#endif +#elif defined(_MSC_VER) // MSVC #define ARROW_NORETURN __declspec(noreturn) #define ARROW_NOINLINE __declspec(noinline) #define ARROW_FORCE_INLINE __declspec(forceinline) #define ARROW_PREDICT_FALSE(x) (x) #define ARROW_PREDICT_TRUE(x) (x) #define ARROW_PREFETCH(addr) +#define ARROW_RESTRICT __restrict +#define ARROW_COMPILER_ASSUME(expr) __assume(expr) #else #define ARROW_NORETURN #define ARROW_NOINLINE @@ -65,12 +111,8 @@ #define ARROW_PREDICT_FALSE(x) (x) #define ARROW_PREDICT_TRUE(x) (x) #define ARROW_PREFETCH(addr) -#endif - -#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) -#define ARROW_RESTRICT __restrict -#else #define ARROW_RESTRICT +#define ARROW_COMPILER_ASSUME(expr) #endif // ---------------------------------------------------------------------- diff --git a/dev/tasks/python-wheels/github.osx.yml b/dev/tasks/python-wheels/github.osx.yml index e7b6d7898103b..cf99c84c60bfd 100644 --- a/dev/tasks/python-wheels/github.osx.yml +++ b/dev/tasks/python-wheels/github.osx.yml @@ -17,8 +17,7 @@ {% import 'macros.jinja' as macros with context %} {{ macros.github_header() }} - -env: +# env: is generated by macros.github_header() ARROW_JEMALLOC: "{{ arrow_jemalloc }}" CC: "clang" CMAKE_BUILD_TYPE: release diff --git a/dev/tasks/verify-rc/github.macos.yml b/dev/tasks/verify-rc/github.macos.yml index 642cee2bb9aec..8963954dba49d 100644 --- a/dev/tasks/verify-rc/github.macos.yml +++ b/dev/tasks/verify-rc/github.macos.yml @@ -20,8 +20,7 @@ {{ macros.github_header() }} {% set use_conda = use_conda|default(False) %} - -env: +# env: is generated by macros.github_header() # Current oldest supported version according to https://endoflife.date/macos MACOSX_DEPLOYMENT_TARGET: "10.15" diff --git a/docs/source/index.rst b/docs/source/index.rst index 2ca63c5ebdbc4..57143b1196552 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -109,6 +109,7 @@ Implementations JavaScript Julia MATLAB + nanoarrow Python R Ruby diff --git a/docs/source/status.rst b/docs/source/status.rst index dc60b311a1489..f4672d6b4bc55 100644 --- a/docs/source/status.rst +++ b/docs/source/status.rst @@ -28,88 +28,88 @@ stated, the Python, R, Ruby and C/GLib libraries follow the C++ Arrow library. Data Types ========== -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Data type | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -| (primitive) | | | | | | | | | -+===================+=======+=======+=======+============+=======+=======+=======+=======+ -| Null | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Boolean | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Int8/16/32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| UInt8/16/32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Float16 | ✓ | ✓ (1) | ✓ | ✓ | ✓ (2)| ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Float32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Decimal128 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Decimal256 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Date32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Time32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Timestamp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Duration | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Interval | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Fixed Size Binary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Binary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Large Binary | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Utf8 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Large Utf8 | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Binary View | ✓ | | ✓ | | ✓ | | | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Large Binary View | ✓ | | ✓ | | | | | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Utf8 View | ✓ | | ✓ | | ✓ | | | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Large Utf8 View | ✓ | | ✓ | | | | | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ - -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Data type | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -| (nested) | | | | | | | | | -+===================+=======+=======+=======+============+=======+=======+=======+=======+ -| Fixed Size List | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| List | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Large List | ✓ | ✓ | ✓ | | | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| List View | ✓ | | ✓ | | ✓ | | | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Large List View | ✓ | | ✓ | | | | | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Struct | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Map | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Dense Union | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Sparse Union | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ - -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Data type | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -| (special) | | | | | | | | | -+===================+=======+=======+=======+============+=======+=======+=======+=======+ -| Dictionary | ✓ | ✓ (3) | ✓ | ✓ | ✓ | ✓ (3) | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Extension | ✓ | ✓ | ✓ | | | ✓ | ✓ | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Run-End Encoded | ✓ | | ✓ | | | | | | -+-------------------+-------+-------+-------+------------+-------+-------+-------+-------+ ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Data type | C++ | Java | Go | JS | C# | Rust | Julia | Swift | nanoarrow | +| (primitive) | | | | | | | | | | ++===================+=======+=======+=======+====+=======+=======+=======+=======+===========+ +| Null | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Boolean | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Int8/16/32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| UInt8/16/32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Float16 | ✓ | ✓ (1) | ✓ | ✓ | ✓ (2)| ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Float32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Decimal128 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Decimal256 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Date32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Time32/64 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Timestamp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Duration | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Interval | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Fixed Size Binary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Binary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Large Binary | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Utf8 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Large Utf8 | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Binary View | ✓ | | ✓ | | ✓ | | | | | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Large Binary View | ✓ | | ✓ | | | | | | | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Utf8 View | ✓ | | ✓ | | ✓ | | | | | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Large Utf8 View | ✓ | | ✓ | | | | | | | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ + ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Data type | C++ | Java | Go | JS | C# | Rust | Julia | Swift | nanoarrow | +| (nested) | | | | | | | | | | ++===================+=======+=======+=======+====+=======+=======+=======+=======+===========+ +| Fixed Size List | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| List | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Large List | ✓ | ✓ | ✓ | | | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| List View | ✓ | | ✓ | | ✓ | | | | | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Large List View | ✓ | | ✓ | | | | | | | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Struct | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Map | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Dense Union | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Sparse Union | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ + ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Data type | C++ | Java | Go | JS | C# | Rust | Julia | Swift | nanoarrow | +| (special) | | | | | | | | | | ++===================+=======+=======+=======+====+=======+=======+=======+=======+===========+ +| Dictionary | ✓ | ✓ (3) | ✓ | ✓ | ✓ | ✓ (3) | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Extension | ✓ | ✓ | ✓ | | | ✓ | ✓ | | ✓ | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Run-End Encoded | ✓ | | ✓ | | | | | | | ++-------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +-----------------------+-------+-------+-------+------------+-------+-------+-------+-------+ | Canonical | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | @@ -134,32 +134,32 @@ Notes: IPC Format ========== -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| IPC Feature | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -| | | | | | | | | | -+=============================+=======+=======+=======+============+=======+=======+=======+=======+ -| Arrow stream format | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Arrow file format | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Record batches | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Dictionaries | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Replacement dictionaries | ✓ | ✓ | ✓ | | | | ✓ | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Delta dictionaries | ✓ (1) | | ✓ (1) | ✓ | ✓ | | ✓ | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Tensors | ✓ | | | | | | | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Sparse tensors | ✓ | | | | | | | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Buffer compression | ✓ | ✓ (3) | ✓ | | ✓ | ✓ | ✓ | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Endianness conversion | ✓ (2) | | ✓ (2) | | | | | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Custom schema metadata | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | -+-----------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| IPC Feature | C++ | Java | Go | JS | C# | Rust | Julia | Swift | nanoarrow | +| | | | | | | | | | | ++=============================+=======+=======+=======+====+=======+=======+=======+=======+===========+ +| Arrow stream format | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (4) | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Arrow file format | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Record batches | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Dictionaries | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Replacement dictionaries | ✓ | ✓ | ✓ | | | | ✓ | | | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Delta dictionaries | ✓ (1) | | ✓ (1) | ✓ | ✓ | | ✓ | | | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Tensors | ✓ | | | | | | | | | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Sparse tensors | ✓ | | | | | | | | | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Buffer compression | ✓ | ✓ (3) | ✓ | | ✓ | ✓ | ✓ | | | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Endianness conversion | ✓ (2) | | ✓ (2) | | | | | | ✓ (2) | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ +| Custom schema metadata | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ++-----------------------------+-------+-------+-------+----+-------+-------+-------+-------+-----------+ Notes: @@ -169,6 +169,8 @@ Notes: * \(3) LZ4 Codec currently is quite inefficient. ARROW-11901 tracks improving performance. +* \(4) The nanoarrow IPC implementation is only implemented for reading IPC streams. + .. seealso:: The :ref:`format-ipc` specification. @@ -177,57 +179,57 @@ Notes: Flight RPC ========== -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Flight RPC Transport | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -+============================================+=======+=======+=======+============+=======+=======+=======+=======+ -| gRPC_ transport (grpc:, grpc+tcp:) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| gRPC domain socket transport (grpc+unix:) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| gRPC + TLS transport (grpc+tls:) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| UCX_ transport (ucx:) | ✓ | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Flight RPC Transport | C++ | Java | Go | JS | C# | Rust | Julia | Swift | ++============================================+=======+=======+=======+====+=======+=======+=======+=======+ +| gRPC_ transport (grpc:, grpc+tcp:) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| gRPC domain socket transport (grpc+unix:) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| gRPC + TLS transport (grpc+tls:) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| UCX_ transport (ucx:) | ✓ | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ Supported features in the gRPC transport: -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Flight RPC Feature | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -+============================================+=======+=======+=======+============+=======+=======+=======+=======+ -| All RPC methods | ✓ | ✓ | ✓ | | × (1) | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Authentication handlers | ✓ | ✓ | ✓ | | ✓ (2) | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Call timeouts | ✓ | ✓ | ✓ | | | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Call cancellation | ✓ | ✓ | ✓ | | | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Concurrent client calls (3) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Custom middleware | ✓ | ✓ | ✓ | | | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| RPC error codes | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Flight RPC Feature | C++ | Java | Go | JS | C# | Rust | Julia | Swift | ++============================================+=======+=======+=======+====+=======+=======+=======+=======+ +| All RPC methods | ✓ | ✓ | ✓ | | ✓ (1) | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Authentication handlers | ✓ | ✓ | ✓ | | ✓ (2) | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Call timeouts | ✓ | ✓ | ✓ | | | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Call cancellation | ✓ | ✓ | ✓ | | | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Concurrent client calls (3) | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Custom middleware | ✓ | ✓ | ✓ | | | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| RPC error codes | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ Supported features in the UCX transport: -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Flight RPC Feature | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -+============================================+=======+=======+=======+============+=======+=======+=======+=======+ -| All RPC methods | × (4) | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Authentication handlers | | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Call timeouts | | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Call cancellation | | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Concurrent client calls | ✓ (5) | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Custom middleware | | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| RPC error codes | ✓ | | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Flight RPC Feature | C++ | Java | Go | JS | C# | Rust | Julia | Swift | ++============================================+=======+=======+=======+====+=======+=======+=======+=======+ +| All RPC methods | ✓ (4) | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Authentication handlers | | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Call timeouts | | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Call cancellation | | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Concurrent client calls | ✓ (5) | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Custom middleware | | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| RPC error codes | ✓ | | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ Notes: @@ -255,55 +257,55 @@ The feature support refers to the client/server libraries only; databases which implement the Flight SQL protocol in turn will support/not support individual features. -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| Feature | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -+============================================+=======+=======+=======+============+=======+=======+=======+=======+ -| BeginSavepoint | ✓ | ✓ | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| BeginTransaction | ✓ | ✓ | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| CancelQuery | ✓ | ✓ | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| ClosePreparedStatement | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| CreatePreparedStatement | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| CreatePreparedSubstraitPlan | ✓ | ✓ | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| EndSavepoint | ✓ | ✓ | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| EndTransaction | ✓ | ✓ | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetCatalogs | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetCrossReference | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetDbSchemas | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetExportedKeys | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetImportedKeys | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetPrimaryKeys | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetSqlInfo | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetTables | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetTableTypes | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| GetXdbcTypeInfo | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| PreparedStatementQuery | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| PreparedStatementUpdate | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| StatementSubstraitPlan | ✓ | ✓ | | | | | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| StatementQuery | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ -| StatementUpdate | ✓ | ✓ | ✓ | | ✓ | ✓ | | | -+--------------------------------------------+-------+-------+-------+------------+-------+-------+-------+-------+ ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| Feature | C++ | Java | Go | JS | C# | Rust | Julia | Swift | ++============================================+=======+=======+=======+====+=======+=======+=======+=======+ +| BeginSavepoint | ✓ | ✓ | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| BeginTransaction | ✓ | ✓ | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| CancelQuery | ✓ | ✓ | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| ClosePreparedStatement | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| CreatePreparedStatement | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| CreatePreparedSubstraitPlan | ✓ | ✓ | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| EndSavepoint | ✓ | ✓ | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| EndTransaction | ✓ | ✓ | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetCatalogs | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetCrossReference | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetDbSchemas | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetExportedKeys | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetImportedKeys | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetPrimaryKeys | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetSqlInfo | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetTables | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetTableTypes | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| GetXdbcTypeInfo | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| PreparedStatementQuery | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| PreparedStatementUpdate | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| StatementSubstraitPlan | ✓ | ✓ | | | | | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| StatementQuery | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ +| StatementUpdate | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ++--------------------------------------------+-------+-------+-------+----+-------+-------+-------+-------+ .. seealso:: The :doc:`./format/FlightSql` specification. @@ -311,18 +313,18 @@ support/not support individual features. C Data Interface ================ -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ -| Feature | C++ | Python | R | Rust | Go | Java | C/GLib | Ruby | Julia | C# | Swift | -| | | | | | | | | | | | | -+=============================+=====+========+===+======+====+======+========+======+=======+=====+=======+ -| Schema export | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ -| Array export | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ -| Schema import | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ -| Array import | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ +| Feature | C++ | Python | R | Rust | Go | Java | C/GLib | Ruby | Julia | C# | Swift | nanoarrow | +| | | | | | | | | | | | | | ++=============================+=====+========+===+======+====+======+========+======+=======+=====+=======+===========+ +| Schema export | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | ✓ | ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ +| Array export | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | ✓ | ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ +| Schema import | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | ✓ | ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ +| Array import | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | ✓ | ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ .. seealso:: The :ref:`C Data Interface ` specification. @@ -331,14 +333,14 @@ C Data Interface C Stream Interface ================== -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ -| Feature | C++ | Python | R | Rust | Go | Java | C/GLib | Ruby | Julia | C# | Swift | -| | | | | | | | | | | | | -+=============================+=====+========+===+======+====+======+========+======+=======+=====+=======+ -| Stream export | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ -| Stream import | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | -+-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+ ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ +| Feature | C++ | Python | R | Rust | Go | Java | C/GLib | Ruby | Julia | C# | Swift | nanoarrow | +| | | | | | | | | | | | | | ++=============================+=====+========+===+======+====+======+========+======+=======+=====+=======+===========+ +| Stream export | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | ✓ | ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ +| Stream import | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | ✓ | ++-----------------------------+-----+--------+---+------+----+------+--------+------+-------+-----+-------+-----------+ .. seealso:: The :ref:`C Stream Interface ` specification. @@ -347,18 +349,18 @@ C Stream Interface Third-Party Data Formats ======================== -+-----------------------------+---------+---------+-------+------------+-------+-------+-------+-------+ -| Format | C++ | Java | Go | JavaScript | C# | Rust | Julia | Swift | -| | | | | | | | | | -+=============================+=========+=========+=======+============+=======+=======+=======+=======+ -| Avro | | R | | | | | | | -+-----------------------------+---------+---------+-------+------------+-------+-------+-------+-------+ -| CSV | R/W | R (2) | R/W | | | R/W | R/W | | -+-----------------------------+---------+---------+-------+------------+-------+-------+-------+-------+ -| ORC | R/W | R (1) | | | | | | | -+-----------------------------+---------+---------+-------+------------+-------+-------+-------+-------+ -| Parquet | R/W | R (2) | R/W | | | R/W | | | -+-----------------------------+---------+---------+-------+------------+-------+-------+-------+-------+ ++-----------------------------+---------+---------+-------+----+-------+-------+-------+-------+ +| Format | C++ | Java | Go | JS | C# | Rust | Julia | Swift | +| | | | | | | | | | ++=============================+=========+=========+=======+====+=======+=======+=======+=======+ +| Avro | | R | | | | | | | ++-----------------------------+---------+---------+-------+----+-------+-------+-------+-------+ +| CSV | R/W | R (2) | R/W | | | R/W | R/W | | ++-----------------------------+---------+---------+-------+----+-------+-------+-------+-------+ +| ORC | R/W | R (1) | | | | | | | ++-----------------------------+---------+---------+-------+----+-------+-------+-------+-------+ +| Parquet | R/W | R (2) | R/W | | | R/W | | | ++-----------------------------+---------+---------+-------+----+-------+-------+-------+-------+ Notes: diff --git a/go/go.mod b/go/go.mod index d2871edbf0c91..af7c937800ff1 100644 --- a/go/go.mod +++ b/go/go.mod @@ -35,9 +35,9 @@ require ( github.com/stretchr/testify v1.9.0 github.com/zeebo/xxh3 v1.0.2 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - golang.org/x/sync v0.6.0 + golang.org/x/sync v0.7.0 golang.org/x/sys v0.19.0 - golang.org/x/tools v0.19.0 + golang.org/x/tools v0.20.0 golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 gonum.org/v1/gonum v0.15.0 google.golang.org/grpc v1.62.1 @@ -75,7 +75,7 @@ require ( github.com/tidwall/gjson v1.14.2 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect - golang.org/x/mod v0.16.0 // indirect + golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect diff --git a/go/go.sum b/go/go.sum index 850a3b10224e8..9d42ed49ab57c 100644 --- a/go/go.sum +++ b/go/go.sum @@ -117,12 +117,12 @@ golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -130,8 +130,8 @@ golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= diff --git a/java/flight/flight-core/pom.xml b/java/flight/flight-core/pom.xml index 9ea6393f0f6df..991ac491cf96a 100644 --- a/java/flight/flight-core/pom.xml +++ b/java/flight/flight-core/pom.xml @@ -288,7 +288,7 @@ maven-assembly-plugin - 3.0.0 + 3.7.1 jar-with-dependencies diff --git a/java/flight/flight-integration-tests/pom.xml b/java/flight/flight-integration-tests/pom.xml index 905c8bdaf013b..5a073a0f801ad 100644 --- a/java/flight/flight-integration-tests/pom.xml +++ b/java/flight/flight-integration-tests/pom.xml @@ -64,7 +64,7 @@ maven-assembly-plugin - 3.0.0 + 3.7.1 jar-with-dependencies diff --git a/java/maven/module-info-compiler-maven-plugin/pom.xml b/java/maven/module-info-compiler-maven-plugin/pom.xml index 910fede33ce3b..c276e807e9855 100644 --- a/java/maven/module-info-compiler-maven-plugin/pom.xml +++ b/java/maven/module-info-compiler-maven-plugin/pom.xml @@ -76,7 +76,7 @@ maven-clean-plugin - 3.1.0 + 3.3.2 maven-plugin-plugin diff --git a/java/maven/pom.xml b/java/maven/pom.xml index f6a6da3afe53e..0491b859d8580 100644 --- a/java/maven/pom.xml +++ b/java/maven/pom.xml @@ -240,7 +240,7 @@ org.slf4j jcl-over-slf4j - 2.0.11 + 2.0.12 diff --git a/java/performance/pom.xml b/java/performance/pom.xml index 3f69be32a20e5..18d347fae05d6 100644 --- a/java/performance/pom.xml +++ b/java/performance/pom.xml @@ -179,7 +179,7 @@ maven-clean-plugin - 2.5 + 3.3.2 maven-deploy-plugin diff --git a/java/pom.xml b/java/pom.xml index 9892061677d09..9d932ae9104da 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -31,7 +31,7 @@ ${project.build.directory}/generated-sources 1.9.0 5.10.2 - 2.0.11 + 2.0.12 33.0.0-jre 4.1.108.Final 1.63.0 diff --git a/java/tools/pom.xml b/java/tools/pom.xml index 9b55f07c013d3..77d1d6a5f1e35 100644 --- a/java/tools/pom.xml +++ b/java/tools/pom.xml @@ -85,7 +85,7 @@ maven-assembly-plugin - 3.0.0 + 3.7.1 jar-with-dependencies diff --git a/python/pyarrow/array.pxi b/python/pyarrow/array.pxi index 59d2e91ef6c70..45fd29ad3b3f3 100644 --- a/python/pyarrow/array.pxi +++ b/python/pyarrow/array.pxi @@ -561,34 +561,7 @@ def _normalize_slice(object arrow_obj, slice key): Py_ssize_t start, stop, step Py_ssize_t n = len(arrow_obj) - step = key.step or 1 - - if key.start is None: - if step < 0: - start = n - 1 - else: - start = 0 - elif key.start < 0: - start = key.start + n - if start < 0: - start = 0 - elif key.start >= n: - start = n - else: - start = key.start - - if step < 0 and (key.stop is None or key.stop < -n): - stop = -1 - elif key.stop is None: - stop = n - elif key.stop < 0: - stop = key.stop + n - if stop < 0: # step > 0 in this case. - stop = 0 - elif key.stop >= n: - stop = n - else: - stop = key.stop + start, stop, step = key.indices(n) if step != 1: indices = np.arange(start, stop, step) diff --git a/python/pyarrow/tests/test_array.py b/python/pyarrow/tests/test_array.py index 60794ebef3281..472a6c5dce750 100644 --- a/python/pyarrow/tests/test_array.py +++ b/python/pyarrow/tests/test_array.py @@ -486,6 +486,7 @@ def test_array_slice_negative_step(): slice(None, None, 2), slice(0, 10, 2), slice(15, -25, -1), # GH-38768 + slice(-22, -22, -1), # GH-40642 ] for case in cases: