NAME
PDL::DuckDB - Vectorized SQL/DataFrame engine (DuckDB) bindings for PDL
SYNOPSIS
use PDL;
use PDL::DuckDB qw(connect duckdb_version);
my $db = connect(':memory:');
$db->exec('CREATE TABLE t (grp VARCHAR, x DOUBLE)');
$db->exec("INSERT INTO t VALUES ('a', 1.5), ('a', 2.5), ('b', 10.0)");
my $cols = $db->query_pdl(
'SELECT grp, SUM(x) AS total, AVG(x) AS mean FROM t GROUP BY grp ORDER BY grp'
);
# $cols->{total} and $cols->{mean} are PDL double ndarrays
# $cols->{grp} is ['a', 'b']
DESCRIPTION
PDL::DuckDB binds PDL ndarrays directly to DuckDB's pure-C API (duckdb.h) via C99 XS, providing a platform-agnostic, vectorized, multithreaded SQL/DataFrame engine (joins, group-bys, window functions, and native Parquet/CSV querying) that returns numeric columns directly as PDL ndarrays.
FUNCTIONS
connect
Open a DuckDB database (default ':memory:') and return a PDL::DuckDB::Connection.
$db = connect();
$db = connect('analytics.duckdb');
duckdb_version
Return the linked DuckDB library version string.
$ver = duckdb_version();
SEE ALSO
PDL, PDL::IO::Arrow, PDL::Torch, PDL::XGBoost
AUTHOR
C.J. Collier <cjac@google.com>
LICENSE
Licensed under the Apache License, Version 2.0.