Skip to content

Commit cd031ef

Browse files
khalidmammadovrtyler
authored andcommitted
fix(cdf): make cdf builders build function accessible
Signed-off-by: khalidmammadov <khalidmammadov9@gmail.com>
1 parent e85896d commit cd031ef

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

crates/core/src/operations/load_cdf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl CdfLoadBuilder {
343343
}
344344

345345
/// Executes the scan
346-
pub(crate) async fn build(
346+
pub async fn build(
347347
&self,
348348
session: &dyn Session,
349349
filters: Option<&Arc<dyn PhysicalExpr>>,

docs/src/rust/read_cdf.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
#[tokio::main]
22
async fn main() -> Result<(), Box<dyn std::error::Error>> {
33

4-
let table = deltalake::open_table("tmp/some-table").await?;
4+
let table = deltalake::open_table("/abs/tmp/some-table").await?;
55
let ctx = SessionContext::new();
6-
let ops = DeltaOps(table);
7-
let cdf = ops
8-
.load_cdf()
6+
let cdf = table.scan_cdf()
97
.with_starting_version(0)
108
.with_ending_version(4)
11-
.build()
9+
.build(&ctx.state(), None)
1210
.await?;
1311

1412
let batches = collect_batches(
1513
cdf.properties().output_partitioning().partition_count(),
16-
&cdf,
14+
cdf.as_ref(),
1715
ctx,
1816
).await?;
1917
arrow_cast::pretty::print_batches(&batches)?;
@@ -24,7 +22,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
2422

2523
async fn collect_batches(
2624
num_partitions: usize,
27-
stream: &impl ExecutionPlan,
25+
stream: &dyn ExecutionPlan,
2826
ctx: SessionContext,
2927
) -> Result<Vec<RecordBatch>, Box<dyn std::error::Error>> {
3028
let mut batches = vec![];

0 commit comments

Comments
 (0)