Skip to content

Commit

Permalink
Fix 1 test while at it
Browse files Browse the repository at this point in the history
  • Loading branch information
trzysiek committed May 7, 2024
1 parent d0505b4 commit 3ca71eb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions quesma/testdata/aggregation_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2251,6 +2251,11 @@ var AggregationTests = []AggregationTestCase{
"max": {
"field": "@timestamp"
}
},
"average_timestamp": {
"avg": {
"field": "@timestamp"
}
}
},
"query": {
Expand Down Expand Up @@ -2300,6 +2305,9 @@ var AggregationTests = []AggregationTestCase{
},
"latest_timestamp": {
"value": null
},
"average_timestamp": {
"value": null
}
},
"hits": {
Expand All @@ -2317,11 +2325,13 @@ var AggregationTests = []AggregationTestCase{
}`,
[][]model.QueryResultRow{
{{Cols: []model.QueryResultCol{model.NewQueryResultCol("hits", uint64(0))}}},
{}, // on purpose, simulates no rows returned
{}, // on purpose, simulates no rows returned
{{Cols: []model.QueryResultCol{model.NewQueryResultCol(`minOrNull("@timestamp")`, nil)}}},
{{Cols: []model.QueryResultCol{model.NewQueryResultCol(`maxOrNull("@timestamp")`, nil)}}},
{{Cols: []model.QueryResultCol{model.NewQueryResultCol(`maxOrNull("@timestamp")`, nil)}}},
},
[]string{
`SELECT count() FROM "` + TableName + `" WHERE "message" iLIKE '%posei%' AND "message" iLIKE '%User logged out%' AND "host.name" iLIKE '%poseidon%' `,
`SELECT avgOrNull("@timestamp") FROM "` + TableName + `" WHERE "message" iLIKE '%posei%' AND "message" iLIKE '%User logged out%' AND "host.name" iLIKE '%poseidon%' `,
`SELECT minOrNull("@timestamp") FROM "` + TableName + `" WHERE "message" iLIKE '%posei%' AND "message" iLIKE '%User logged out%' AND "host.name" iLIKE '%poseidon%' `,
`SELECT maxOrNull("@timestamp") FROM "` + TableName + `" WHERE "message" iLIKE '%posei%' AND "message" iLIKE '%User logged out%' AND "host.name" iLIKE '%poseidon%' `,
},
Expand Down

0 comments on commit 3ca71eb

Please sign in to comment.