Skip to content

Commit

Permalink
Validate that predicate is correctly passed to engine
Browse files Browse the repository at this point in the history
  • Loading branch information
OussamaSaoudi-db committed Sep 17, 2024
1 parent 59c4988 commit a9b2375
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions acceptance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ tracing-subscriber = { version = "0.3", default-features = false, features = [
"env-filter",
"fmt",
] }
env_logger = "0.11.5"

[[test]]
name = "dat_reader"
Expand Down
1 change: 1 addition & 0 deletions acceptance/tests/dat_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use delta_kernel::engine::default::executor::tokio::TokioBackgroundExecutor;
use delta_kernel::engine::default::DefaultEngine;

fn reader_test(path: &Path) -> datatest_stable::Result<()> {
let _ = env_logger::try_init();
let root_dir = format!(
"{}/{}",
env!["CARGO_MANIFEST_DIR"],
Expand Down
4 changes: 3 additions & 1 deletion kernel/src/engine/default/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use futures::{StreamExt, TryStreamExt};
use itertools::Itertools;
use object_store::path::Path;
use object_store::{DynObjectStore, GetResultPayload};
use tracing::debug;

use super::executor::TaskExecutor;
use super::file_stream::{FileOpenFuture, FileOpener, FileStream};
Expand Down Expand Up @@ -119,8 +120,9 @@ impl<E: TaskExecutor> JsonHandler for DefaultJsonHandler<E> {
&self,
files: &[FileMeta],
physical_schema: SchemaRef,
_predicate: Option<Expression>,
predicate: Option<Expression>,
) -> DeltaResult<FileDataReadResultIterator> {
debug!("Reading json files with predicate: {:?}", predicate);
if files.is_empty() {
return Ok(Box::new(std::iter::empty()));
}
Expand Down
4 changes: 3 additions & 1 deletion kernel/src/engine/default/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use parquet::arrow::arrow_reader::{
ArrowReaderMetadata, ArrowReaderOptions, ParquetRecordBatchReaderBuilder,
};
use parquet::arrow::async_reader::{ParquetObjectReader, ParquetRecordBatchStreamBuilder};
use tracing::debug;

use super::file_stream::{FileOpenFuture, FileOpener, FileStream};
use crate::engine::arrow_utils::{generate_mask, get_requested_indices, reorder_struct_array};
Expand Down Expand Up @@ -47,8 +48,9 @@ impl<E: TaskExecutor> ParquetHandler for DefaultParquetHandler<E> {
&self,
files: &[FileMeta],
physical_schema: SchemaRef,
_predicate: Option<Expression>,
predicate: Option<Expression>,
) -> DeltaResult<FileDataReadResultIterator> {
debug!("Reading parquet files with predicate: {:?}", predicate);
if files.is_empty() {
return Ok(Box::new(std::iter::empty()));
}
Expand Down

0 comments on commit a9b2375

Please sign in to comment.