2022-01-26 04:04:25 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pytestCheckHook
|
|
|
|
, libiconv
|
|
|
|
, numpy
|
2023-04-29 16:46:19 +00:00
|
|
|
, protobuf
|
2022-01-26 04:04:25 +00:00
|
|
|
, pyarrow
|
2023-04-29 16:46:19 +00:00
|
|
|
, Security
|
2022-01-26 04:04:25 +00:00
|
|
|
}:
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
let
|
2023-02-16 17:41:37 +00:00
|
|
|
arrow-testing = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "arrow-testing";
|
2023-02-16 17:41:37 +00:00
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-testing";
|
2023-04-29 16:46:19 +00:00
|
|
|
rev = "47f7b56b25683202c1fd957668e13f2abafc0f12";
|
|
|
|
hash = "sha256-ZDznR+yi0hm5O1s9as8zq5nh1QxJ8kXCRwbNQlzXpnI=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
parquet-testing = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "parquet-testing";
|
2023-02-16 17:41:37 +00:00
|
|
|
owner = "apache";
|
|
|
|
repo = "parquet-testing";
|
2023-04-29 16:46:19 +00:00
|
|
|
rev = "b2e7cc755159196e3a068c8594f7acbaecfdaaac";
|
|
|
|
hash = "sha256-IFvGTOkaRSNgZOj8DziRj88yH5JRF+wgSDZ5N0GNvjk=";
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
2022-01-26 04:04:25 +00:00
|
|
|
in
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "datafusion";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "22.0.0";
|
2022-01-26 04:04:25 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
name = "datafusion-source";
|
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-datafusion-python";
|
|
|
|
rev = "22.0.0";
|
|
|
|
hash = "sha256-EKurQ4h5IOTU3JiGN+MHrDciQUadUrywNRhnv9S/9iY=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "datafusion-cargo-deps";
|
2023-02-16 17:41:37 +00:00
|
|
|
inherit src pname version;
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-0kfavTFqsQ1Uvg5nQw6VFGlvih8ysOyS2KGT4cTIsVI=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
buildInputs = [ protobuf ] ++ lib.optionals stdenv.isDarwin [ libiconv Security ];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
propagatedBuildInputs = [ pyarrow ];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook numpy ];
|
2022-01-26 04:04:25 +00:00
|
|
|
pythonImportsCheck = [ "datafusion" ];
|
2023-02-16 17:41:37 +00:00
|
|
|
pytestFlagsArray = [ "--pyargs" pname ];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
pushd $TMPDIR
|
|
|
|
ln -s ${arrow-testing} ./testing
|
|
|
|
ln -s ${parquet-testing} ./parquet
|
|
|
|
'';
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
postCheck = ''
|
|
|
|
popd
|
2022-01-26 04:04:25 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Extensible query execution framework";
|
|
|
|
longDescription = ''
|
|
|
|
DataFusion is an extensible query execution framework, written in Rust,
|
|
|
|
that uses Apache Arrow as its in-memory format.
|
|
|
|
'';
|
|
|
|
homepage = "https://arrow.apache.org/datafusion/";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|