@@ -2265,121 +2265,6 @@ mod tests {
22652265 Ok ( ( ) )
22662266 }
22672267
2268- #[ tokio:: test]
2269- async fn aggregate_timestamps_sum ( ) -> Result < ( ) > {
2270- let tmp_dir = TempDir :: new ( ) ?;
2271- let mut ctx = create_ctx ( & tmp_dir, 1 ) . await ?;
2272- ctx. register_table ( "t" , test:: table_with_timestamps ( ) )
2273- . unwrap ( ) ;
2274-
2275- let results = plan_and_collect (
2276- & mut ctx,
2277- "SELECT sum(nanos), sum(micros), sum(millis), sum(secs) FROM t" ,
2278- )
2279- . await
2280- . unwrap_err ( ) ;
2281-
2282- assert_eq ! ( results. to_string( ) , "Error during planning: The function Sum does not support inputs of type Timestamp(Nanosecond, None)." ) ;
2283-
2284- Ok ( ( ) )
2285- }
2286-
2287- #[ tokio:: test]
2288- async fn aggregate_timestamps_count ( ) -> Result < ( ) > {
2289- let tmp_dir = TempDir :: new ( ) ?;
2290- let mut ctx = create_ctx ( & tmp_dir, 1 ) . await ?;
2291- ctx. register_table ( "t" , test:: table_with_timestamps ( ) )
2292- . unwrap ( ) ;
2293-
2294- let results = plan_and_collect (
2295- & mut ctx,
2296- "SELECT count(nanos), count(micros), count(millis), count(secs) FROM t" ,
2297- )
2298- . await
2299- . unwrap ( ) ;
2300-
2301- let expected = vec ! [
2302- "+----------------+-----------------+-----------------+---------------+" ,
2303- "| COUNT(t.nanos) | COUNT(t.micros) | COUNT(t.millis) | COUNT(t.secs) |" ,
2304- "+----------------+-----------------+-----------------+---------------+" ,
2305- "| 3 | 3 | 3 | 3 |" ,
2306- "+----------------+-----------------+-----------------+---------------+" ,
2307- ] ;
2308- assert_batches_sorted_eq ! ( expected, & results) ;
2309-
2310- Ok ( ( ) )
2311- }
2312-
2313- #[ tokio:: test]
2314- async fn aggregate_timestamps_min ( ) -> Result < ( ) > {
2315- let tmp_dir = TempDir :: new ( ) ?;
2316- let mut ctx = create_ctx ( & tmp_dir, 1 ) . await ?;
2317- ctx. register_table ( "t" , test:: table_with_timestamps ( ) )
2318- . unwrap ( ) ;
2319-
2320- let results = plan_and_collect (
2321- & mut ctx,
2322- "SELECT min(nanos), min(micros), min(millis), min(secs) FROM t" ,
2323- )
2324- . await
2325- . unwrap ( ) ;
2326-
2327- let expected = vec ! [
2328- "+----------------------------+----------------------------+-------------------------+---------------------+" ,
2329- "| MIN(t.nanos) | MIN(t.micros) | MIN(t.millis) | MIN(t.secs) |" ,
2330- "+----------------------------+----------------------------+-------------------------+---------------------+" ,
2331- "| 2011-12-13 11:13:10.123450 | 2011-12-13 11:13:10.123450 | 2011-12-13 11:13:10.123 | 2011-12-13 11:13:10 |" ,
2332- "+----------------------------+----------------------------+-------------------------+---------------------+" ,
2333- ] ;
2334- assert_batches_sorted_eq ! ( expected, & results) ;
2335-
2336- Ok ( ( ) )
2337- }
2338-
2339- #[ tokio:: test]
2340- async fn aggregate_timestamps_max ( ) -> Result < ( ) > {
2341- let tmp_dir = TempDir :: new ( ) ?;
2342- let mut ctx = create_ctx ( & tmp_dir, 1 ) . await ?;
2343- ctx. register_table ( "t" , test:: table_with_timestamps ( ) )
2344- . unwrap ( ) ;
2345-
2346- let results = plan_and_collect (
2347- & mut ctx,
2348- "SELECT max(nanos), max(micros), max(millis), max(secs) FROM t" ,
2349- )
2350- . await
2351- . unwrap ( ) ;
2352-
2353- let expected = vec ! [
2354- "+-------------------------+-------------------------+-------------------------+---------------------+" ,
2355- "| MAX(t.nanos) | MAX(t.micros) | MAX(t.millis) | MAX(t.secs) |" ,
2356- "+-------------------------+-------------------------+-------------------------+---------------------+" ,
2357- "| 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10 |" ,
2358- "+-------------------------+-------------------------+-------------------------+---------------------+" ,
2359- ] ;
2360- assert_batches_sorted_eq ! ( expected, & results) ;
2361-
2362- Ok ( ( ) )
2363- }
2364-
2365- #[ tokio:: test]
2366- async fn aggregate_timestamps_avg ( ) -> Result < ( ) > {
2367- let tmp_dir = TempDir :: new ( ) ?;
2368- let mut ctx = create_ctx ( & tmp_dir, 1 ) . await ?;
2369- ctx. register_table ( "t" , test:: table_with_timestamps ( ) )
2370- . unwrap ( ) ;
2371-
2372- let results = plan_and_collect (
2373- & mut ctx,
2374- "SELECT avg(nanos), avg(micros), avg(millis), avg(secs) FROM t" ,
2375- )
2376- . await
2377- . unwrap_err ( ) ;
2378-
2379- assert_eq ! ( results. to_string( ) , "Error during planning: The function Avg does not support inputs of type Timestamp(Nanosecond, None)." ) ;
2380- Ok ( ( ) )
2381- }
2382-
23832268 #[ tokio:: test]
23842269 async fn aggregate_avg_add ( ) -> Result < ( ) > {
23852270 let results = execute (
@@ -2418,56 +2303,6 @@ mod tests {
24182303 Ok ( ( ) )
24192304 }
24202305
2421- #[ tokio:: test]
2422- async fn join_timestamp ( ) -> Result < ( ) > {
2423- let tmp_dir = TempDir :: new ( ) ?;
2424- let mut ctx = create_ctx ( & tmp_dir, 1 ) . await ?;
2425- ctx. register_table ( "t" , test:: table_with_timestamps ( ) )
2426- . unwrap ( ) ;
2427-
2428- let expected = vec ! [
2429- "+-------------------------------+----------------------------+-------------------------+---------------------+-------+-------------------------------+----------------------------+-------------------------+---------------------+-------+" ,
2430- "| nanos | micros | millis | secs | name | nanos | micros | millis | secs | name |" ,
2431- "+-------------------------------+----------------------------+-------------------------+---------------------+-------+-------------------------------+----------------------------+-------------------------+---------------------+-------+" ,
2432- "| 2011-12-13 11:13:10.123450 | 2011-12-13 11:13:10.123450 | 2011-12-13 11:13:10.123 | 2011-12-13 11:13:10 | Row 1 | 2011-12-13 11:13:10.123450 | 2011-12-13 11:13:10.123450 | 2011-12-13 11:13:10.123 | 2011-12-13 11:13:10 | Row 1 |" ,
2433- "| 2018-11-13 17:11:10.011375885 | 2018-11-13 17:11:10.011375 | 2018-11-13 17:11:10.011 | 2018-11-13 17:11:10 | Row 0 | 2018-11-13 17:11:10.011375885 | 2018-11-13 17:11:10.011375 | 2018-11-13 17:11:10.011 | 2018-11-13 17:11:10 | Row 0 |" ,
2434- "| 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10 | Row 3 | 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10.432 | 2021-01-01 05:11:10 | Row 3 |" ,
2435- "+-------------------------------+----------------------------+-------------------------+---------------------+-------+-------------------------------+----------------------------+-------------------------+---------------------+-------+" ,
2436- ] ;
2437-
2438- let results = plan_and_collect (
2439- & mut ctx,
2440- "SELECT * FROM t as t1 \
2441- JOIN (SELECT * FROM t) as t2 \
2442- ON t1.nanos = t2.nanos",
2443- )
2444- . await
2445- . unwrap ( ) ;
2446- assert_batches_sorted_eq ! ( expected, & results) ;
2447-
2448- let results = plan_and_collect (
2449- & mut ctx,
2450- "SELECT * FROM t as t1 \
2451- JOIN (SELECT * FROM t) as t2 \
2452- ON t1.micros = t2.micros",
2453- )
2454- . await
2455- . unwrap ( ) ;
2456- assert_batches_sorted_eq ! ( expected, & results) ;
2457-
2458- let results = plan_and_collect (
2459- & mut ctx,
2460- "SELECT * FROM t as t1 \
2461- JOIN (SELECT * FROM t) as t2 \
2462- ON t1.millis = t2.millis",
2463- )
2464- . await
2465- . unwrap ( ) ;
2466- assert_batches_sorted_eq ! ( expected, & results) ;
2467-
2468- Ok ( ( ) )
2469- }
2470-
24712306 #[ tokio:: test]
24722307 async fn count_basic ( ) -> Result < ( ) > {
24732308 let results = execute ( "SELECT COUNT(c1), COUNT(c2) FROM test" , 1 ) . await ?;
0 commit comments