File tree 2 files changed +8
-2
lines changed 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -978,6 +978,11 @@ impl ScalarValue {
978
978
ScalarValue :: from ( val. into ( ) )
979
979
}
980
980
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
+
981
986
/// Returns a [`ScalarValue::IntervalYearMonth`] representing
982
987
/// `years` years and `months` months
983
988
pub fn new_interval_ym ( years : i32 , months : i32 ) -> Self {
Original file line number Diff line number Diff line change @@ -149,8 +149,9 @@ async fn page_index_filter_one_col() {
149
149
let session_ctx = SessionContext :: new ( ) ;
150
150
let task_ctx = session_ctx. task_ctx ( ) ;
151
151
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" ) ) ) ;
154
155
let parquet_exec = get_parquet_exec ( & state, filter) . await ;
155
156
let mut results = parquet_exec. execute ( 0 , task_ctx. clone ( ) ) . unwrap ( ) ;
156
157
let batch = results. next ( ) . await . unwrap ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments