docs: add GitHub issue and PR templates (#23)
Java bindings for Apache DataFusion. Queries run in native Rust and results return to the JVM as Apache Arrow batches via the Arrow C Data Interface.
Early development: no releases yet, API will change. Bug reports and contributions 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(); // ... } } }
SessionContext and DataFrame are AutoCloseable and not thread-safe.
Query interfaces:
SessionContext.sql(String)select, filter (other transformations TBD)LogicalPlanNode: SessionContext.fromProto(byte[]). The datafusion-proto Java classes are generated by the build.Data sources:
registerParquet / readParquet, with ParquetReadOptionsregisterCsv / readCsv, with CsvReadOptionsResults:
DataFrame.collect(allocator) — Arrow C Data Interface streamDataFrame.count(), show(), show(int)SessionContext.tableSchema(String)Not yet:
SessionConfig / RuntimeEnv knobswrite_* outputsJDK 17+. Building from source: see CONTRIBUTING.md.
src/ — Java sources and testsnative/ — Rust crate (JNI + Arrow C Data Interface)Open an issue to discuss non-trivial changes before sending a PR. See CONTRIBUTING.md.
Apache License 2.0. See LICENSE.txt and NOTICE.txt.