2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
pytestCheckHook,
|
|
|
|
libiconv,
|
|
|
|
numpy,
|
|
|
|
protobuf,
|
|
|
|
pyarrow,
|
|
|
|
Security,
|
|
|
|
SystemConfiguration,
|
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-06-20 14:57:18 +00:00
|
|
|
version = "38.0.1";
|
|
|
|
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-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-rBS6i2HqpdhnhZZfO0ywL/e4a+rnUZkHzezKd8PuG80=";
|
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;
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-M2ZNAFWdsnN9C4+YbqFxZVH9fHR10Bimf1Xzrd9oy9E=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs =
|
|
|
|
[ protobuf ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
libiconv
|
|
|
|
Security
|
|
|
|
SystemConfiguration
|
|
|
|
];
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
numpy
|
|
|
|
];
|
2022-01-26 04:04:25 +00:00
|
|
|
pythonImportsCheck = [ "datafusion" ];
|
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 ];
|
|
|
|
};
|
|
|
|
}
|