mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Add more tests for GroupBy on Time fields
This commit is contained in:
parent
113bec2474
commit
6cbcde3a82
1 changed files with 26 additions and 4 deletions
|
|
@ -6903,6 +6903,14 @@ austin,1,0
|
|||
toronto,6,0
|
||||
mombasa,1,0
|
||||
sydney,1,0
|
||||
`,
|
||||
},
|
||||
{ // 2019 January only
|
||||
query: `GroupBy(Rows(places_visited, from='2019-01-01T00:00', to='2019-02-01T00:00'))`,
|
||||
csvVerifier: `nairobi,1,0
|
||||
paris,1,0
|
||||
austin,1,0
|
||||
toronto,1,0
|
||||
`,
|
||||
},
|
||||
{ // 2019 All
|
||||
|
|
@ -6913,12 +6921,26 @@ austin,1,0
|
|||
toronto,3,0
|
||||
`,
|
||||
},
|
||||
{ // 2019 January only
|
||||
query: `GroupBy(Rows(places_visited, from='2019-01-01T00:00', to='2019-02-01T00:00'))`,
|
||||
{ // 2019 All, this excludes userC (who likes pangolin & icecream) from the count.
|
||||
// UserC visited Paris and Toronto in 2019
|
||||
query: `GroupBy(
|
||||
Rows(places_visited, from='2019-01-01T00:00', to='2019-12-31T23:59'),
|
||||
filter=Not(Intersect(Row(likes='pangolin'), Row(likes='icecream')))
|
||||
)`,
|
||||
csvVerifier: `nairobi,1,0
|
||||
paris,1,0
|
||||
austin,1,0
|
||||
toronto,1,0
|
||||
toronto,2,0
|
||||
`,
|
||||
},
|
||||
{ // After excluding UserC, this gets the sum of the networth of everyone per cities travelled
|
||||
query: `GroupBy(
|
||||
Rows(places_visited, from='2019-01-01T00:00', to='2019-12-31T23:59'),
|
||||
filter=Not(Intersect(Row(likes='pangolin'), Row(likes='icecream'))),
|
||||
aggregate=Sum(field=net_worth)
|
||||
)`,
|
||||
csvVerifier: `nairobi,1,10
|
||||
austin,1,100000
|
||||
toronto,2,11
|
||||
`,
|
||||
},
|
||||
{ // 2020 & 2019 All
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue