Skip to content

Commit f77611c

Browse files
authored
Replace "::<type>" casts to explicit casting functions (#114639)
Fixes #114613 Those tests were added with `::<type>` casts, which don't work in older versions. As they aren't testing anything around those casts, I'm replacing them with `TO_<TYPE>()` functions to let them work everywhere.
1 parent e56f24f commit f77611c

File tree

1 file changed

+8
-8
lines changed
  • x-pack/plugin/esql/qa/testFixtures/src/main/resources

1 file changed

+8
-8
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/date.csv-spec

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ date1:date | dd_ms:integer
369369

370370
evalDateDiffMonthAsWhole0Months
371371

372-
ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2024-01-01T00:00:00"::DATETIME
372+
ROW from=TO_DATETIME("2023-12-31T23:59:59.999Z"), to=TO_DATETIME("2024-01-01T00:00:00")
373373
| EVAL msecs=DATE_DIFF("milliseconds", from, to), months=DATE_DIFF("month", from, to)
374374
;
375375

@@ -380,7 +380,7 @@ ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2024-01-01T00:00:00"::DATETIM
380380

381381
evalDateDiffMonthAsWhole1Month
382382

383-
ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2024-02-01T00:00:00"::DATETIME
383+
ROW from=TO_DATETIME("2023-12-31T23:59:59.999Z"), to=TO_DATETIME("2024-02-01T00:00:00")
384384
| EVAL secs=DATE_DIFF("seconds", from, to), months=DATE_DIFF("month", from, to)
385385
;
386386

@@ -392,7 +392,7 @@ ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2024-02-01T00:00:00"::DATETIM
392392
evalDateDiffYearAsWhole0Years
393393
required_capability: date_diff_year_calendarial
394394

395-
ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2024-01-01T00:00:00"::DATETIME
395+
ROW from=TO_DATETIME("2023-12-31T23:59:59.999Z"), to=TO_DATETIME("2024-01-01T00:00:00")
396396
| EVAL msecs=DATE_DIFF("milliseconds", from, to), years=DATE_DIFF("year", from, to)
397397
;
398398

@@ -403,7 +403,7 @@ ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2024-01-01T00:00:00"::DATETIM
403403
evalDateDiffYearAsWhole1Year
404404
required_capability: date_diff_year_calendarial
405405

406-
ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2025-01-01T00:00:00"::DATETIME
406+
ROW from=TO_DATETIME("2023-12-31T23:59:59.999Z"), to=TO_DATETIME("2025-01-01T00:00:00")
407407
| EVAL secs=DATE_DIFF("seconds", from, to), years=DATE_DIFF("year", from, to)
408408
;
409409

@@ -414,7 +414,7 @@ ROW from="2023-12-31T23:59:59.999Z"::DATETIME, to="2025-01-01T00:00:00"::DATETIM
414414
evalDateDiffYearAsWhole1Year
415415
required_capability: date_diff_year_calendarial
416416

417-
ROW from="2024-01-01T00:00:00Z"::DATETIME, to="2025-01-01T00:00:00"::DATETIME
417+
ROW from=TO_DATETIME("2024-01-01T00:00:00Z"), to=TO_DATETIME("2025-01-01T00:00:00")
418418
| EVAL secs=DATE_DIFF("seconds", from, to), years=DATE_DIFF("year", from, to)
419419
;
420420

@@ -426,9 +426,9 @@ evalDateDiffYearForDocs
426426
required_capability: date_diff_year_calendarial
427427

428428
// tag::evalDateDiffYearForDocs[]
429-
ROW end_23="2023-12-31T23:59:59.999Z"::DATETIME,
430-
start_24="2024-01-01T00:00:00.000Z"::DATETIME,
431-
end_24="2024-12-31T23:59:59.999"::DATETIME
429+
ROW end_23=TO_DATETIME("2023-12-31T23:59:59.999Z"),
430+
start_24=TO_DATETIME("2024-01-01T00:00:00.000Z"),
431+
end_24=TO_DATETIME("2024-12-31T23:59:59.999")
432432
| EVAL end23_to_start24=DATE_DIFF("year", end_23, start_24)
433433
| EVAL end23_to_end24=DATE_DIFF("year", end_23, end_24)
434434
| EVAL start_to_end_24=DATE_DIFF("year", start_24, end_24)

0 commit comments

Comments
 (0)