Skip to content

Commit 13804a8

Browse files
authored
Adjust two today()/current_date() tests to create less noise (elastic#138588) (elastic#138596)
1 parent 8c73e8c commit 13804a8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

x-pack/plugin/sql/qa/server/src/main/resources/date.csv-spec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ SELECT TRUNCATE(YEAR(TODAY() - INTERVAL 50 YEARS) / 1000) AS result;
3838

3939

4040
currentDateFilter
41-
SELECT first_name FROM test_emp WHERE hire_date > CURRENT_DATE() - INTERVAL 45 YEARS ORDER BY first_name ASC LIMIT 10;
41+
SELECT first_name FROM test_emp WHERE hire_date > DATE_TRUNC('CENTURY', CURRENT_DATE()) - INTERVAL 11 YEARS ORDER BY first_name ASC LIMIT 10;
4242

4343
first_name
4444
-----------------
4545
Alejandro
4646
Amabile
4747
Anneke
4848
Anoosh
49-
Arumugam
5049
Basil
51-
Berhard
52-
Berni
53-
Bezalel
5450
Bojan
51+
Brendon
52+
Cristinel
53+
Divier
54+
Domenick
5555
;
5656

5757
currentDateFilterScript

x-pack/plugin/sql/qa/server/src/main/resources/docs/docs.csv-spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,15 +3345,15 @@ SELECT TODAY() AS result;
33453345

33463346
filterToday
33473347
// tag::filterToday
3348-
SELECT first_name FROM emp WHERE hire_date > TODAY() - INTERVAL 35 YEARS ORDER BY first_name ASC LIMIT 5;
3348+
SELECT first_name FROM emp WHERE hire_date > DATE_TRUNC('CENTURY', TODAY()) - INTERVAL 11 YEARS ORDER BY first_name ASC LIMIT 5;
33493349

33503350
first_name
33513351
------------
33523352
Alejandro
33533353
Amabile
3354+
Anneke
33543355
Anoosh
33553356
Basil
3356-
Cristinel
33573357
// end::filterToday
33583358
;
33593359

0 commit comments

Comments
 (0)