Skip to content

Commit fdce8bf

Browse files
committed
Fix parquet page pruning test
1 parent 915f14f commit fdce8bf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

datafusion/common/src/scalar/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,11 @@ impl ScalarValue {
978978
ScalarValue::from(val.into())
979979
}
980980

981+
/// Returns a [`ScalarValue::Utf8View`] representing `val`
982+
pub fn new_utf8view(val: impl Into<String>) -> Self {
983+
ScalarValue::Utf8View(Some(val.into()))
984+
}
985+
981986
/// Returns a [`ScalarValue::IntervalYearMonth`] representing
982987
/// `years` years and `months` months
983988
pub fn new_interval_ym(years: i32, months: i32) -> Self {

datafusion/core/tests/parquet/page_pruning.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ async fn page_index_filter_one_col() {
149149
let session_ctx = SessionContext::new();
150150
let task_ctx = session_ctx.task_ctx();
151151

152-
// 5.create filter date_string_col == 1;
153-
let filter = col("date_string_col").eq(lit("01/01/09"));
152+
// 5.create filter date_string_col == "01/01/09"`;
153+
// Note this test doesn't apply type coercion so the literal must match the actual view type
154+
let filter = col("date_string_col").eq(lit(ScalarValue::new_utf8view("01/01/09")));
154155
let parquet_exec = get_parquet_exec(&state, filter).await;
155156
let mut results = parquet_exec.execute(0, task_ctx.clone()).unwrap();
156157
let batch = results.next().await.unwrap().unwrap();

0 commit comments

Comments
 (0)