Skip to content

Commit 9ed0aea

Browse files
committed
Add ESQLCapabilities gate
1 parent db1ac6c commit 9ed0aea

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,7 @@ y:date | c:long
18381838
;
18391839

18401840
dayNameSimple
1841+
required_capability: day_name_function
18411842
from employees
18421843
| sort emp_no
18431844
| keep emp_no, hire_date
@@ -1849,6 +1850,7 @@ emp_no:integer | hire_date:date | day:keyword
18491850
;
18501851

18511852
dayNameTruncate
1853+
required_capability: day_name_function
18521854
FROM employees
18531855
| EVAL a = hire_date
18541856
| RENAME hire_date as b
@@ -1869,6 +1871,7 @@ y:date | c:long | week_day:keyword
18691871
;
18701872

18711873
dayNameNestedCall
1874+
required_capability: day_name_function
18721875
from employees
18731876
| sort emp_no
18741877
| eval first_day_of_month = day_name(date_trunc(1 month, hire_date))
@@ -1889,10 +1892,11 @@ emp_no:integer | hire_date:datetime | first_day_of_month:keyword
18891892
;
18901893

18911894
dayNameNestedCall
1895+
required_capability: day_name_function
18921896
from employees
18931897
| sort emp_no desc
18941898
| eval first_day_of_month = to_upper(day_name(date_trunc(1 month, hire_date)))
1895-
| keep emp_no, hire_date, first_day_of_monthf
1899+
| keep emp_no, hire_date, first_day_of_month
18961900
| limit 10;
18971901

18981902
emp_no:integer | hire_date:datetime | first_day_of_month:keyword
@@ -1909,6 +1913,7 @@ emp_no:integer | hire_date:datetime | first_day_of_month:keyword
19091913
;
19101914

19111915
dayNameNull
1916+
required_capability: day_name_function
19121917
from employees | where emp_no == 10040 | eval x = day_name(birth_date) | keep emp_no, birth_date, hire_date, x;
19131918

19141919
emp_no:integer | birth_date:date | hire_date:date | x:keyword

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,12 @@ public enum Cap {
13351335
/**
13361336
* Support correct counting of skipped shards.
13371337
*/
1338-
CORRECT_SKIPPED_SHARDS_COUNT;
1338+
CORRECT_SKIPPED_SHARDS_COUNT,
1339+
1340+
/**
1341+
* Supports DAY_NAME function
1342+
*/
1343+
DAY_NAME_FUNCTION;
13391344

13401345
private final boolean enabled;
13411346

0 commit comments

Comments
 (0)