diff --git a/quesma/testdata/aggregation_requests.go b/quesma/testdata/aggregation_requests.go index a99ac8bba..35a56817b 100644 --- a/quesma/testdata/aggregation_requests.go +++ b/quesma/testdata/aggregation_requests.go @@ -2251,6 +2251,11 @@ var AggregationTests = []AggregationTestCase{ "max": { "field": "@timestamp" } + }, + "average_timestamp": { + "avg": { + "field": "@timestamp" + } } }, "query": { @@ -2300,6 +2305,9 @@ var AggregationTests = []AggregationTestCase{ }, "latest_timestamp": { "value": null + }, + "average_timestamp": { + "value": null } }, "hits": { @@ -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%' `, },