Skip to content

Commit 180d936

Browse files
update docs
1 parent 575d24d commit 180d936

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/reference/query-languages/esql/esql-multi-index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ FROM events_*
135135
| 2023-10-23T12:27:28.948Z | 172.21.2.113 | 2764889 | Connected to 10.1.0.2 |
136136
| 2023-10-23T12:15:03.360Z | 172.21.2.162 | 3450233 | Connected to 10.1.0.3 |
137137

138+
### Date and date_nanos union type [esql-multi-index-date-date-nanos-union]
139+
138140
When the type of an {{ES|QL}} field is a *union* of `date` and `date_nanos` across different indices, {{ES|QL}} automatically casts all values to the `date_nanos` type during query execution. This implicit casting ensures that all values are handled with nanosecond precision, regardless of their original type. As a result, users can write queries against such fields without needing to perform explicit type conversions, and the query engine will seamlessly align the types for consistent and precise results.
139141

140142
For example, if the `@timestamp` field is mapped as `date` in one index and `date_nanos` in another, {{ES|QL}} will automatically treat all `@timestamp` values as `date_nanos` during query execution. This allows users to write queries that utilize the `@timestamp` field without encountering type mismatch errors, ensuring accurate time-based operations and comparisons across the combined dataset.

0 commit comments

Comments
 (0)