| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| [package] |
| name = "datafusion-jni" |
| version = "0.1.0" |
| edition = "2021" |
| publish = false |
| |
| [lib] |
| # `rlib` alongside `cdylib` so `cargo test` has a Rust-level harness for |
| # native-only invariants (e.g. error-classification routing through wrapped |
| # DataFusionError chains). The `cdylib` is still the artifact the JVM loads. |
| crate-type = ["cdylib", "rlib"] |
| |
| [features] |
| # Object-store backends are on by default (per PR #73) so `make test` exercises |
| # them; downstream builds that strip a feature get a clear runtime error if a |
| # caller tries to register an unsupported backend. Substrait is opt-in: the |
| # transitive `substrait` crate's build script invokes its own `prost_build`, |
| # and our `build.rs`'s vendored `PROTOC` only applies to our own compilation, |
| # so making substrait default-on would force `protoc` on every clean build. |
| default = [ |
| "object-store-aws", |
| "object-store-gcp", |
| "object-store-http", |
| ] |
| object-store-aws = ["object_store/aws"] |
| object-store-gcp = ["object_store/gcp"] |
| object-store-http = ["object_store/http"] |
| # Pulls in `datafusion-substrait` so `SessionContext.fromSubstrait(byte[])` can |
| # decode and execute Substrait plans. Enable explicitly: |
| # |
| # cargo build --features substrait # needs protoc on PATH |
| # cargo build --features substrait,protoc # vendor protoc via cmake |
| # |
| # The JNI handler throws a clear "feature not enabled" error from the JVM if |
| # invoked in a build that compiled the feature off, so the Java surface is |
| # unchanged either way. |
| substrait = ["dep:datafusion-substrait"] |
| # Forwards to `datafusion-substrait/protoc`, which uses `protobuf-src` (compiles |
| # protoc from source via cmake) so the substrait dependency stack does not |
| # require a system `protoc`. Useful for hermetic builds; requires cmake. |
| protoc = ["datafusion-substrait?/protoc"] |
| # Pulls in `tokio-metrics` so `SessionContext.runtimeStats()` returns real |
| # numbers from the underlying Tokio runtime. Off by default because |
| # `tokio-metrics` only compiles when `--cfg tokio_unstable` is set, and we |
| # don't want to force that flag onto every build. Enable explicitly: |
| # |
| # RUSTFLAGS="--cfg tokio_unstable" cargo build --features runtime-metrics |
| # |
| # The JNI handler returns a clear "feature not enabled" error from the JVM if |
| # invoked in a build that compiled the feature off, so the Java surface is |
| # unchanged either way. |
| runtime-metrics = ["dep:tokio-metrics"] |
| |
| [dependencies] |
| arrow = { version = "58", features = ["ffi"] } |
| async-trait = "0.1" |
| datafusion = { version = "53.1.0", features = ["avro"] } |
| datafusion-proto = "53.1.0" |
| datafusion-substrait = { version = "53.1.0", optional = true } |
| futures = "0.3" |
| jni = "0.21" |
| # Pin to the same major as DataFusion 53.1 pulls in transitively (0.13.x) |
| # so we share the same `dyn ObjectStore` vtable and don't double-link. |
| object_store = { version = "0.13", default-features = false } |
| prost = "0.14" |
| tokio = { version = "1", features = ["rt-multi-thread"] } |
| # Tokio runtime metrics. Optional + cfg-gated: this crate's API surface lives |
| # behind `--cfg tokio_unstable`, so enabling the `runtime-metrics` feature also |
| # requires the caller to set `RUSTFLAGS="--cfg tokio_unstable"` at build time. |
| tokio-metrics = { version = "0.5", optional = true } |
| url = "2" |
| |
| [build-dependencies] |
| prost-build = "0.14" |
| protoc-bin-vendored = "3" |