Skip to content

Commit d122393

Browse files
committed
Move ffi module to datafusion core
1 parent 405a89f commit d122393

File tree

9 files changed

+546
-1216
lines changed

9 files changed

+546
-1216
lines changed

Cargo.lock

Lines changed: 543 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ datafusion = { version = "43.0.0", features = ["pyarrow", "avro", "unicode_expre
4141
datafusion-substrait = { version = "43.0.0", optional = true }
4242
datafusion-proto = { version = "43.0.0" }
4343
datafusion-functions-window-common = { version = "43.0.0" }
44+
datafusion-ffi = { version = "43.0.0" }
4445
prost = "0.13" # keep in line with `datafusion-substrait`
4546
uuid = { version = "1.11", features = ["v4"] }
4647
mimalloc = { version = "0.1", optional = true, default-features = false, features = ["local_dynamic_tls"] }

src/context.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use crate::dataset::Dataset;
3838
use crate::errors::{py_datafusion_err, DataFusionError};
3939
use crate::expr::sort_expr::PySortExpr;
4040
use crate::expr::PyExpr;
41-
use crate::ffi::table_provider::FFI_TableProvider;
4241
use crate::physical_plan::PyExecutionPlan;
4342
use crate::record_batch::PyRecordBatchStream;
4443
use crate::sql::logical::PyLogicalPlan;
@@ -70,6 +69,7 @@ use datafusion::physical_plan::SendableRecordBatchStream;
7069
use datafusion::prelude::{
7170
AvroReadOptions, CsvReadOptions, DataFrame, NdJsonReadOptions, ParquetReadOptions,
7271
};
72+
use datafusion_ffi::table_provider::{FFI_TableProvider, ForeignTableProvider};
7373
use pyo3::types::{PyCapsule, PyDict, PyList, PyTuple};
7474
use tokio::task::JoinHandle;
7575

@@ -582,9 +582,7 @@ impl PySessionContext {
582582
// validate_pycapsule(capsule, "arrow_array_stream")?;
583583

584584
let provider = unsafe { FFI_TableProvider::from_raw(capsule.pointer() as _) };
585-
586-
println!("Found provider version {}", provider.version);
587-
585+
let provider = ForeignTableProvider::new(provider);
588586
let schema = provider.schema();
589587
println!("Got schema through TableProvider trait.");
590588

0 commit comments

Comments
 (0)