Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

8 changes: 8 additions & 0 deletions x-pack/plugin/esql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ tasks.named("test").configure {

List kibana = kibanaTree.files.collect { it.name }
int countKibana = kibana.size()
Closure replaceLinks = line -> {
// The kibana docs are not deployed to the normal docs location, so need absolute paths for internal references
line.replaceAll(
/\]\(\/reference\/([^)\s]+)\.md(#\S+)?\)/,
'](https://www.elastic.co/docs/reference/elasticsearch/$1$2)'
)
}
if (countKibana == 0) {
logger.quiet("ESQL Docs: No function/operator kibana docs created. Skipping sync.")
} else {
Expand All @@ -181,6 +188,7 @@ tasks.named("test").configure {
include '**/*.md', '**/*.json'
}
}
filter replaceLinks
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ emp_no:integer | languages:integer | height:double
convertToDatePeriod
required_capability: cast_string_literal_to_temporal_amount
//tag::castToDatePeriod[]
row x = "2024-01-01"::datetime | eval y = x + "3 DAYS"::date_period, z = x - to_dateperiod("3 days");
ROW x = "2024-01-01"::datetime
| EVAL y = x + "3 DAYS"::date_period, z = x - TO_DATEPERIOD("3 days");
//end::castToDatePeriod[]

//tag::castToDatePeriod-result[]
Expand All @@ -230,7 +231,8 @@ x:datetime |y:datetime |z:datetime
convertToTimeDuration
required_capability: cast_string_literal_to_temporal_amount
//tag::castToTimeDuration[]
row x = "2024-01-01"::datetime | eval y = x + "3 hours"::time_duration, z = x - to_timeduration("3 hours");
ROW x = "2024-01-01"::datetime
| EVAL y = x + "3 hours"::time_duration, z = x - TO_TIMEDURATION("3 hours");
//end::castToTimeDuration[]

//tag::castToTimeDuration-result[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ null

docsDateDiff#[skip:-8.12.99, reason:date_diff added in 8.13]
// tag::docsDateDiff[]
ROW date1 = TO_DATETIME("2023-12-02T11:00:00.000Z"), date2 = TO_DATETIME("2023-12-02T11:00:00.001Z")
ROW date1 = TO_DATETIME("2023-12-02T11:00:00.000Z"),
date2 = TO_DATETIME("2023-12-02T11:00:00.001Z")
| EVAL dd_ms = DATE_DIFF("microseconds", date1, date2)
// end::docsDateDiff[]
;
Expand Down Expand Up @@ -425,12 +426,12 @@ evalDateDiffYearForDocs
required_capability: date_diff_year_calendarial

// tag::evalDateDiffYearForDocs[]
ROW end_23=TO_DATETIME("2023-12-31T23:59:59.999Z"),
start_24=TO_DATETIME("2024-01-01T00:00:00.000Z"),
end_24=TO_DATETIME("2024-12-31T23:59:59.999")
| EVAL end23_to_start24=DATE_DIFF("year", end_23, start_24)
| EVAL end23_to_end24=DATE_DIFF("year", end_23, end_24)
| EVAL start_to_end_24=DATE_DIFF("year", start_24, end_24)
ROW end_23 = TO_DATETIME("2023-12-31T23:59:59.999Z"),
start_24 = TO_DATETIME("2024-01-01T00:00:00.000Z"),
end_24 = TO_DATETIME("2024-12-31T23:59:59.999")
| EVAL end23_to_start24 = DATE_DIFF("year", end_23, start_24)
| EVAL end23_to_end24 = DATE_DIFF("year", end_23, end_24)
| EVAL start_to_end_24 = DATE_DIFF("year", start_24, end_24)
// end::evalDateDiffYearForDocs[]
;

Expand Down Expand Up @@ -1002,7 +1003,8 @@ date:date | year:long
docsDateExtractBusinessHours
// tag::docsDateExtractBusinessHours[]
FROM sample_data
| WHERE DATE_EXTRACT("hour_of_day", @timestamp) < 9 AND DATE_EXTRACT("hour_of_day", @timestamp) >= 17
| WHERE DATE_EXTRACT("hour_of_day", @timestamp) < 9
AND DATE_EXTRACT("hour_of_day", @timestamp) >= 17
// end::docsDateExtractBusinessHours[]
;

Expand Down Expand Up @@ -1214,16 +1216,20 @@ required_capability: agg_values
mvAppendDates
required_capability: fn_mv_append

// tag::mv_append_date[]
FROM employees
| WHERE emp_no == 10039 OR emp_no == 10040
| SORT emp_no
| EVAL dates = mv_append(birth_date, hire_date)
| EVAL dates = MV_APPEND(birth_date, hire_date)
| KEEP emp_no, birth_date, hire_date, dates
// end::mv_append_date[]
;

// tag::mv_append_date-result[]
emp_no:integer | birth_date:date | hire_date:date | dates:date
10039 | 1959-10-01T00:00:00Z | 1988-01-19T00:00:00Z | [1959-10-01T00:00:00Z, 1988-01-19T00:00:00Z]
10040 | null | 1993-02-14T00:00:00Z | null
// end::mv_append_date-result[]
;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,19 @@ date nanos less than
required_capability: to_date_nanos
required_capability: date_nanos_binary_comparison

FROM date_nanos | WHERE MV_MIN(nanos) < TO_DATE_NANOS("2023-10-23T12:27:28.948Z") AND millis > "2000-01-01" | SORT nanos DESC;
// tag::to_date_nanos[]
FROM date_nanos
| WHERE MV_MIN(nanos) < TO_DATE_NANOS("2023-10-23T12:27:28.948Z")
AND millis > "2000-01-01"
| SORT nanos DESC
// end::to_date_nanos[]
;

// tag::to_date_nanos-result[]
millis:date | nanos:date_nanos | num:long
2023-10-23T12:15:03.360Z | 2023-10-23T12:15:03.360103847Z | 1698063303360103847
2023-10-23T12:15:03.360Z | 2023-10-23T12:15:03.360103847Z | 1698063303360103847
// end::to_date_nanos-result[]
;

date nanos less than, no mv min
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ beta | 127.0.0.1
ipPrefix
required_capability: fn_ip_prefix
//tag::ipPrefix[]
row ip4 = to_ip("1.2.3.4"), ip6 = to_ip("fe80::cae2:65ff:fece:feb9")
| eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);
ROW ip4 = to_ip("1.2.3.4"), ip6 = TO_IP("fe80::cae2:65ff:fece:feb9")
| EVAL ip4_prefix = IP_PREFIX(ip4, 24, 0), ip6_prefix = IP_PREFIX(ip6, 0, 112);
//end::ipPrefix[]

//tag::ipPrefix-result[]
Expand Down
Loading