anchor.diff:    ] ++ lib.optionals enableShared [
       python3.pkgs.python
       python3.pkgs.numpy
  +  ] ++ lib.optionals enableFlight [
  +    grpc
  +    libnsl
  +    openssl
  +    protobuf
     ];
   
     preConfigure = ''
  
positive.code: { stdenv, lib, fetchurl, fetchFromGitHub, fixDarwinDylibNames
  , autoconf, boost, brotli, cmake, flatbuffers, gflags, glog, gtest, jemalloc
  , lz4, perl, python3, rapidjson, re2, snappy, thrift, tzdata , utf8proc, which
  , zlib, zstd
  , enableShared ? !stdenv.hostPlatform.isStatic
  }:
  
  let
  
negative.code:   ] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
  
    doInstallCheck = true;
    ARROW_TEST_DATA = lib.optionalString doInstallCheck "${arrow-testing}/data";
    PARQUET_TEST_DATA = lib.optionalString doInstallCheck "${parquet-testing}/data";
    GTEST_FILTER =
      let
        # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11398
        filteredTests = lib.optionals stdenv.hostPlatform.isAarch64 [
          "TestFilterKernelWithNumeric/3.CompareArrayAndFilterRandomNumeric"
          "TestFilterKernelWithNumeric/7.CompareArrayAndFilterRandomNumeric"
          "TestCompareKernel.PrimitiveRandomTests"
        ];
      in
      lib.optionalString doInstallCheck "-${builtins.concatStringsSep ":" filteredTests}";
    installCheckInputs = [ perl which ];
    installCheckPhase =
      let
        excludedTests = lib.optionals stdenv.isDarwin [
          # Some plasma tests need to be patched to use a shorter AF_UNIX socket
          # path on Darwin. See https://github.com/NixOS/nix/pull/1085
          "plasma-external-store-tests"
          "plasma-client-tests"
        ];
      in
      ''
        runHook preInstallCheck
  
        ctest -L unittest -V \
          --exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$'
  
        runHook postInstallCheck
      '';
  
    meta = with lib; {
      description = "A cross-language development platform for in-memory data";
  