()
| 1011 | |
| 1012 | #[tokio::test] |
| 1013 | async fn test_aggregate_alias() -> Result<()> { |
| 1014 | let df = test_table().await?; |
| 1015 | |
| 1016 | let df = df |
| 1017 | // GROUP BY `c2 + 1` |
| 1018 | .aggregate(vec![col("c2") + lit(1)], vec![])? |
| 1019 | // SELECT `c2 + 1` as c2 |
| 1020 | .select(vec![(col("c2") + lit(1)).alias("c2")])? |
| 1021 | // GROUP BY c2 as "c2" (alias in expr is not supported by SQL) |
| 1022 | .aggregate(vec![col("c2").alias("c2")], vec![])?; |
| 1023 | |
| 1024 | let df_results = df.collect().await?; |
| 1025 | |
| 1026 | assert_snapshot!( |
| 1027 | batches_to_sort_string(&df_results), |
| 1028 | @r" |
| 1029 | +----+ |
| 1030 | | c2 | |
| 1031 | +----+ |
| 1032 | | 2 | |
| 1033 | | 3 | |
| 1034 | | 4 | |
| 1035 | | 5 | |
| 1036 | | 6 | |
| 1037 | +----+ |
| 1038 | " |
| 1039 | ); |
| 1040 | |
| 1041 | Ok(()) |
| 1042 | } |
| 1043 | |
| 1044 | #[tokio::test] |
| 1045 | async fn test_aggregate_with_union() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…