Skip to content

Commit 7a495ec

Browse files
author
Rickard Lundin
committed
works but superslow
1 parent 0380ea8 commit 7a495ec

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ atomic-counter = "1.0.1"
5555
crossbeam-channel = "0.5.13"
5656
tracing = "0.1.40"
5757
tokio = "1.37.0"
58+
futures = "0.3.30"
5859
[dev-dependencies]
5960
glob = "0.3.1"
6061

src/chunked/recordbatch_output.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use parquet::format;
3434
use rayon::iter::IndexedParallelIterator;
3535
use rayon::prelude::*;
3636
use std::env::VarError;
37+
use std::fmt::Pointer;
3738
use tokio::runtime::Runtime;
3839

3940
use std::fs;
@@ -151,12 +152,9 @@ impl DeltaOut {
151152
.build();
152153

153154

154-
let mut writer = RecordBatchWriter::for_table(&table)
155-
.expect("Failed to make RecordBatchWriter")
155+
let mut writer = RecordBatchWriter::for_table(&table).expect("Failed to make RecordBatchWriter")
156156
.with_writer_properties(writer_properties);
157-
158157

159-
160158
let metadata = table
161159
.metadata()
162160
.expect("Failed to get metadata for the table");
@@ -174,9 +172,11 @@ impl DeltaOut {
174172
break 'outer;
175173
}
176174
let nrb=rb.with_schema(Arc::new(arrow_schema.clone())).unwrap();
177-
info!("nrb rows={} ",nrb.num_rows());
178-
// writer.write(nrb).await.expect("Error Writing batch");
179-
writer.write_with_mode(nrb,WriteMode::MergeSchema);
175+
// let nrb=rb;
176+
info!("nrb rows={} nrb col len {} batchcount={} usize={}",nrb.num_rows(),nrb.columns().len(),writer.buffered_record_batch_count(),writer.buffer_len());
177+
writer.write(nrb).await.expect("writing");
178+
179+
// writer.write_with_mode(nrb,WriteMode::MergeSchema);
180180

181181
}
182182
Err(e) => {
@@ -185,7 +185,7 @@ impl DeltaOut {
185185
}
186186
}
187187
}
188-
info!("closing the writer for parquet");
188+
info!("closing the writer for parquet {}",writer.buffered_record_batch_count());
189189

190190
let adds = writer
191191
.flush_and_commit(&mut table)

0 commit comments

Comments
 (0)