Skip to content

Commit 37f91c7

Browse files
authored
add parquet example (#80)
Change-Id: Id642fcfdf4cd2e8a8bc7a1f01d596082bad0ca59
1 parent 42abf91 commit 37f91c7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

examples/int32_decimal.parquet

478 Bytes
Binary file not shown.

examples/parquet.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extern crate duckdb;
2+
use duckdb::{Connection, Result};
3+
4+
use arrow::record_batch::RecordBatch;
5+
use arrow::util::pretty::print_batches;
6+
7+
fn main() -> Result<()> {
8+
let db = Connection::open_in_memory()?;
9+
db.execute_batch("INSTALL parquet; LOAD parquet;")?;
10+
let rbs: Vec<RecordBatch> = db
11+
.prepare("SELECT * FROM read_parquet('./examples/int32_decimal.parquet');")?
12+
.query_arrow([])?
13+
.collect();
14+
assert!(print_batches(&rbs).is_ok());
15+
Ok(())
16+
}

0 commit comments

Comments
 (0)