2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
pytestCheckHook,
|
|
|
|
libiconv,
|
|
|
|
numpy,
|
|
|
|
protobuf,
|
|
|
|
pyarrow,
|
|
|
|
Security,
|
|
|
|
SystemConfiguration,
|
2024-09-19 14:19:46 +00:00
|
|
|
typing-extensions,
|
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-07-15 17:15:38 +00:00
|
|
|
rev = "5bab2f264a23f5af68f69ea93d24ef1e8e77fc88";
|
|
|
|
hash = "sha256-Pxx8ohUpXb5u1995IvXmxQMqWiDJ+7LAll/AjQP7ph8=";
|
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-07-15 17:15:38 +00:00
|
|
|
rev = "e13af117de7c4f0a4d9908ae3827b3ab119868f3";
|
|
|
|
hash = "sha256-rVI9zyk9IRDlKv4u8BeMb0HRdWLfCpqOlYCeUdA7BB8=";
|
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";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "40.1.0";
|
2024-06-20 14:57:18 +00:00
|
|
|
pyproject = true;
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
name = "datafusion-source";
|
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-datafusion-python";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-5WOSlx4XW9zO6oTY16lWQElShLv0ubflVPfSSEGrFgg=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "datafusion-cargo-deps";
|
2024-09-19 14:19:46 +00:00
|
|
|
inherit src;
|
|
|
|
hash = "sha256-hN03tbnH77VsMDxSMddMHIH00t7lUs5h8rTHbiMIExw=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs =
|
|
|
|
[ protobuf ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-06-05 15:53:02 +00:00
|
|
|
libiconv
|
|
|
|
Security
|
|
|
|
SystemConfiguration
|
|
|
|
];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [
|
|
|
|
pyarrow
|
|
|
|
typing-extensions
|
|
|
|
];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
numpy
|
|
|
|
];
|
2024-09-19 14:19:46 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
pythonImportsCheck = [ "datafusion" ];
|
2024-09-19 14:19:46 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--pyargs"
|
|
|
|
pname
|
|
|
|
];
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
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/";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/apache/arrow-datafusion-python/blob/${version}/CHANGELOG.md";
|
2022-01-26 04:04:25 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|