Add test case
This commit is contained in:
parent
5ed56e4009
commit
14f15da10c
2 changed files with 10 additions and 0 deletions
|
@ -179,6 +179,8 @@ object Query {
|
||||||
|
|
||||||
inline def max: Agg[Long] = Aggregation(AggregationOperator.max, e)
|
inline def max: Agg[Long] = Aggregation(AggregationOperator.max, e)
|
||||||
|
|
||||||
|
inline def sum: Agg[Option[E]] = Aggregation(AggregationOperator.sum, e)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -177,4 +177,12 @@ class MirrorSqlContextSuite extends munit.FunSuite {
|
||||||
"SELECT MAX(f.age) FROM foo f"
|
"SELECT MAX(f.age) FROM foo f"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test("Aggregations - max") {
|
||||||
|
val o = testContext.io(Foos.map(f => f.age).sum)
|
||||||
|
assertEquals(
|
||||||
|
o.sql,
|
||||||
|
"SELECT SUM(f.age) FROM foo f"
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue