blob: 1d07936d32bd358c2d2d4efaf8c439177a647f0f [file]
# 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"]
[dependencies]
arrow = { version = "58", features = ["ffi"] }
async-trait = "0.1"
datafusion = { version = "53.1.0", features = ["avro"] }
datafusion-proto = "53.1.0"
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"
[features]
# Object-store backends are on by default 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. `runtime-metrics` is opt-in because
# it requires the `tokio_unstable` cfg flag at build time (see below).
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 `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"]
[build-dependencies]
prost-build = "0.14"
protoc-bin-vendored = "3"