Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 1e553b2

Browse files
committed
Update tests
1 parent 6fca39d commit 1e553b2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

platform/parsers/elastic_query_dsl/aggregation_parser_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,9 @@ func Test_parseFieldFromScriptField(t *testing.T) {
704704
expectedMatch model.Expr
705705
expectedSuccess bool
706706
}{
707-
{goodQueryMap("doc['field1'].value.getHour()"), model.NewFunction("toHour", model.NewColumnRef("field1")), true},
707+
{goodQueryMap("doc['field1'].value.getHour()"), model.NewFunction(model.DateHourFunction, model.NewColumnRef("field1")), true},
708708
{goodQueryMap("doc['field1'].value.getHour() + doc['field2'].value.getHour()"), nil, false},
709-
{goodQueryMap("doc['field1'].value.hourOfDay"), model.NewFunction("toHour", model.NewColumnRef("field1")), true},
709+
{goodQueryMap("doc['field1'].value.hourOfDay"), model.NewFunction(model.DateHourFunction, model.NewColumnRef("field1")), true},
710710
{goodQueryMap("doc['field1'].value"), nil, false},
711711
{goodQueryMap("value.getHour() + doc['field2'].value.getHour()"), nil, false},
712712
{QueryMap{}, nil, false},

platform/testdata/opensearch-visualize/aggregation_requests.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,8 @@ var AggregationTests = []testdata.AggregationTestCase{
13421342
}},
13431343
},
13441344
ExpectedPancakeSQL: `
1345-
SELECT maxOrNull(toHour("timestamp")) AS "metric__maxAgg_col_0",
1346-
minOrNull(toHour("timestamp")) AS "metric__minAgg_col_0"
1345+
SELECT maxOrNull(__quesma_date_hour("timestamp")) AS "metric__maxAgg_col_0",
1346+
minOrNull(__quesma_date_hour("timestamp")) AS "metric__minAgg_col_0"
13471347
FROM ` + TableName + ``,
13481348
},
13491349
{ // [9]
@@ -1457,9 +1457,9 @@ var AggregationTests = []testdata.AggregationTestCase{
14571457
}},
14581458
},
14591459
ExpectedPancakeSQL: `
1460-
SELECT toHour("timestamp") AS "aggr__2__key_0", count(*) AS "aggr__2__count"
1460+
SELECT __quesma_date_hour("timestamp") AS "aggr__2__key_0", count(*) AS "aggr__2__count"
14611461
FROM ` + TableName + `
1462-
GROUP BY toHour("timestamp") AS "aggr__2__key_0"
1462+
GROUP BY __quesma_date_hour("timestamp") AS "aggr__2__key_0"
14631463
ORDER BY "aggr__2__key_0" ASC`,
14641464
},
14651465
}

platform/testdata/opensearch-visualize/pipeline_aggregation_requests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ var PipelineAggregationTests = []testdata.AggregationTestCase{
850850
ExpectedPancakeSQL: `
851851
SELECT toInt64(toUnixTimestamp64Milli("timestamp") / 600000) AS "aggr__2__key_0",
852852
count(*) AS "aggr__2__count",
853-
sumOrNull(toHour("timestamp")) AS "metric__2__1-metric_col_0"
853+
sumOrNull(__quesma_date_hour("timestamp")) AS "metric__2__1-metric_col_0"
854854
FROM __quesma_table_name
855855
GROUP BY toInt64(toUnixTimestamp64Milli("timestamp") / 600000) AS "aggr__2__key_0"
856856
ORDER BY "aggr__2__key_0" ASC`,
@@ -1726,7 +1726,7 @@ var PipelineAggregationTests = []testdata.AggregationTestCase{
17261726
ExpectedPancakeSQL: `
17271727
SELECT toInt64(toUnixTimestamp64Milli("timestamp") / 600000) AS "aggr__2__key_0",
17281728
count(*) AS "aggr__2__count",
1729-
sumOrNull(toHour("timestamp")) AS "metric__2__1-metric_col_0"
1729+
sumOrNull(__quesma_date_hour("timestamp")) AS "metric__2__1-metric_col_0"
17301730
FROM __quesma_table_name
17311731
GROUP BY toInt64(toUnixTimestamp64Milli("timestamp") / 600000) AS "aggr__2__key_0"
17321732
ORDER BY "aggr__2__key_0" ASC`,

0 commit comments

Comments
 (0)