| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Java bindings for Apache DataFusion, the Rust-based query engine. SQL queries run in native code and results are returned to the JVM as Apache Arrow record batches via the Arrow C Data Interface — no per-row JNI calls, no row-by-row copies.
Project status: early development. This is a brand-new project. The API is small, will change without notice, and there is no published release. Do not depend on it from production code yet. Bug reports, design feedback, and contributions are very welcome.
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.ipc.ArrowReader;
import org.apache.datafusion.DataFrame;
import org.apache.datafusion.SessionContext;
try (var allocator = new RootAllocator();
var ctx = new SessionContext()) {
ctx.registerParquet("orders", "/path/to/orders.parquet");
try (DataFrame df = ctx.sql(
"SELECT o_orderpriority, COUNT(*) AS n " +
"FROM orders GROUP BY o_orderpriority");
ArrowReader reader = df.collect(allocator)) {
while (reader.loadNextBatch()) {
var batch = reader.getVectorSchemaRoot();
// ... consume batch ...
}
}
}The current public surface mirrors a small slice of the Rust DataFusion API:
Both SessionContext and DataFrame are AutoCloseable and not thread-safe.
Maven is bundled via the ./mvnw wrapper; no separate Maven install required.
make test
This builds the native Rust crate and runs the JUnit tests. The steps can be run individually:
cd native && cargo build ./mvnw test
The native library must be built before running JVM tests.
The Parquet integration test reads TPC-H SF1 data (~345 MB across 8 tables in Snappy-compressed Parquet). Generate it once with:
make tpch-data
Tests that need this data skip cleanly if it is missing. make clean does not remove tpch-data/ — delete it manually to reclaim the disk space.
Near-term priorities, roughly in order:
These are intentionally large items — design discussion via GitHub issues before implementation is welcome.
This project follows the Apache DataFusion contribution model. Issues and pull requests are welcome — please open a GitHub issue to discuss any significant change before sending a PR.
Licensed under the Apache License, Version 2.0. See NOTICE.txt for required attributions.
| Back | FazBrowse Home | New Git URL |