Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed May 29, 2024
1 parent 4b59786 commit 7195b37
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datafusion-examples/examples/parquet_index_advanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,19 @@ async fn main() -> Result<()> {
.show()
.await?;
println!("Files pruned: {}\n", provider.index().last_num_pruned());
// the underlying parquet reader reads ranges from all three files

// Run a query that uses the index to prune files.
//
// Using the predicate "value = 150", the IndexTable can skip reading file 1
// (max value 100) and file 3 (min value of 200)
// (max value 1000) and file 3 (min value of 2000)
println!("** Select data, predicate `value = 1500`");
ctx.sql("SELECT file_name, value FROM index_table WHERE value = 1500")
.await?
.show()
.await?;
println!("Files pruned: {}\n", provider.index().last_num_pruned());
// TODO why are there two calls to read bytes from the file?

// Now, use a predicate on both the value and tag columns. The tag column
// is stored in multiple pages and thus we can prune entire pages based on
Expand Down

0 comments on commit 7195b37

Please sign in to comment.