@@ -340,39 +340,9 @@ fn test_sql_where() {
340340 do_test ( ALL_NULL , pred, MISSING , None , None ) ;
341341}
342342
343- // TODO(#1002): we currently don't support file skipping on timestamp columns' max stat since they
344- // are truncated to milliseconds in add.stats.
345- #[ test]
346- fn test_timestamp_skipping_disabled ( ) {
347- let creator = DataSkippingPredicateCreator ;
348- let col = & column_name ! ( "timestamp_col" ) ;
349-
350- assert ! (
351- creator. get_min_stat( col, & DataType :: TIMESTAMP ) . is_some( ) ,
352- "get_min_stat should return Some: allow data skipping on timestamp minValues"
353- ) ;
354- assert_eq ! (
355- creator. get_max_stat( col, & DataType :: TIMESTAMP ) ,
356- None ,
357- "get_max_stat should return None: no data skipping on timestamp maxValues"
358- ) ;
359- assert ! (
360- creator
361- . get_min_stat( col, & DataType :: TIMESTAMP_NTZ )
362- . is_some( ) ,
363- "get_min_stat should return Some: allow data skipping on timestamp_ntz minValues"
364- ) ;
365- assert_eq ! (
366- creator. get_max_stat( col, & DataType :: TIMESTAMP_NTZ ) ,
367- None ,
368- "get_max_stat should return None: no data skipping on timestamp_ntz maxValues"
369- ) ;
370- }
371343
372- // TODO(#1002): we currently don't support file skipping on timestamp columns' max stat since they
373- // are truncated to milliseconds in add.stats.
374344#[ test]
375- fn test_timestamp_predicates_dont_data_skip ( ) {
345+ fn test_timestamp_predicates_data_skip ( ) {
376346 let col = & column_expr ! ( "ts_col" ) ;
377347 for timestamp in [ & Scalar :: Timestamp ( 1000000 ) , & Scalar :: TimestampNtz ( 1000000 ) ] {
378348 // LT will do minValues -> OK
@@ -383,12 +353,12 @@ fn test_timestamp_predicates_dont_data_skip() {
383353 "Column(minValues.ts_col) < 1000000"
384354 ) ;
385355
386- // GT will do maxValues -> BLOCKED
356+ // GT will adjust predicate value for maxValues comparison
387357 let pred = Pred :: gt ( col. clone ( ) , timestamp. clone ( ) ) ;
388358 let skipping_pred = as_data_skipping_predicate ( & pred) ;
389- assert ! (
390- skipping_pred. is_none ( ) ,
391- "Expected no data skipping for timestamp predicate: {pred:#?}, got {skipping_pred:#?} "
359+ assert_eq ! (
360+ skipping_pred. unwrap ( ) . to_string ( ) ,
361+ "Column(maxValues.ts_col) > 999001 "
392362 ) ;
393363
394364 let pred = Pred :: eq ( col. clone ( ) , timestamp. clone ( ) ) ;
0 commit comments