Example for reading from a delta table #7843
Answered
by
theelderbeever
theelderbeever
asked this question in
Q&A
-
As the title says. Looking for an example on how to read from a deltalake table. Is this even possible yet? I have started with something like below. Do I need to implement my own TableProvider somewhere or does anyone know if one already exists? let mut table = match open_table("data/metrics").await {
Ok(tbl) => tbl,
Err(_) => {
let ops = DeltaOps::try_from_uri("data/metrics").await?;
ops.create()
.with_table_name("metrics")
.with_columns(VectorMetric::columns())
.await?
}
};
let mut ctx = SessionContext::new();
ctx.register_table("metrics", Arc::new(table)).unwrap(); |
Beta Was this translation helpful? Give feedback.
Answered by
theelderbeever
Oct 17, 2023
Replies: 1 comment 5 replies
-
There's an implementation of TableProvider here: https://github.com/delta-io/delta-rs/blob/21e369f309941d069636d8b7c8d50b30e2646ea4/rust/src/delta_datafusion/mod.rs#L428 It's behind the datafusion cargo feature. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like it was a version issue. Datafusion 32.0.0 isn't compatible with delta-rs 0.16.0.