elasticsearch/docs/reference
Mark Tozzi 122e728820
[ESQL] Add TO_DATE_NANOS conversion function (#112150)
Resolves #111842

This adds a conversion function that yields DATE_NANOS. Mostly this is straight forward.

It is worth noting that when converting a millisecond date into a nanosecond date, the conversion function truncates it to 0 nanoseconds (i.e. first nanosecond of that millisecond). This is, of course, a bit of an assumption, but I don't have a better assumption we can make. I'd thought about adding a second, optional, parameter to control this behavior, but it's important that TO_DATE_NANOS extend AbstractConvertFunction, which itself extends UnaryScalarFunction, so that it will work correctly with union types. Also, it's unlikely the user will have any better guess than we do for filling in the nanoseconds.

Making that assumption does, however, create some weirdness. Consider two comparisons:

TO_DATETIME("2023-03-23T12:15:03.360103847") == TO_DATETIME("2023-03-23T12:15:03.360") will return true while TO_DATE_NANOS("2023-03-23T12:15:03.360103847") == TO_DATE_NANOS("2023-03-23T12:15:03.360") will return false. This is akin to casting between longs and doubles, where things may compare equal in one type that are not equal in the other. This seems fine, and I can't think of a better way to do it, but it's worth being aware of.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-26 12:03:01 -04:00
..
aggregations Deprecate legacy params from range query (#113286) 2024-09-25 14:48:45 -04:00
analysis Gracefully handle invalid synonym rules in updateable synonyms (#110901) 2024-08-06 10:44:23 -04:00
autoscaling (Doc+) Link API doc to parent object - part1 (#111951) 2024-08-20 14:58:18 -06:00
behavioral-analytics/apis (Doc+) Link API doc to parent object - part1 (#111951) 2024-08-20 14:58:18 -06:00
cat (Doc+) CAT Nodes default columns (#112715) 2024-09-11 15:32:40 -06:00
ccr (Doc+) Link API doc to parent object - part1 (#111951) 2024-08-20 14:58:18 -06:00
cluster Implement CCS telemetry export as part of _cluster/stats (#112310) 2024-09-10 09:31:06 -06:00
commands fix typos (#113329) 2024-09-23 17:38:51 +02:00
connector/apis fix typos (#113329) 2024-09-23 17:38:51 +02:00
data-management [DOC] auto migrate only for default template (#82043) 2022-05-10 11:35:19 -04:00
data-streams Expose global retention settings via data stream lifecycle API (#112210) 2024-09-02 18:40:08 +10:00
docs (+Doc) Link setting reference for action.auto_create_index (#110558) 2024-07-11 07:57:18 -06:00
eql (Doc+) Link API doc to parent object - part1 (#111951) 2024-08-20 14:58:18 -06:00
esql [ESQL] Add TO_DATE_NANOS conversion function (#112150) 2024-09-26 12:03:01 -04:00
features/apis Simplify reset-features API (#110866) 2024-07-15 13:23:21 +01:00
fleet [Fleet] Fix Fleet API docs (#97981) 2023-07-27 17:22:44 +02:00
graph Fix a couple of docs typos (#99028) 2023-08-30 09:01:34 -04:00
health [DOCS] Fixes the description of 'affected_resources' in health API documentation (#111833) 2024-08-13 18:51:49 +02:00
high-availability Round up shard allocation / recovery / relocation concepts (#109943) 2024-07-25 14:44:57 -04:00
how-to (Doc+) "min_primary_shard_size" for 10-50GB shards (#111574) 2024-08-21 11:57:09 +02:00
ilm ILM: Add total_shards_per_node setting to searchable snapshot (#112972) 2024-09-23 13:37:58 -04:00
images [DOCS] Update Using ESQL in Kibana doc (#108715) 2024-05-17 12:36:04 +02:00
index-modules #101472 Updates default index.translog.flush_threshold_size value (#112052) 2024-09-10 11:08:53 +02:00
indices Adding component template substitutions to the simulate ingest API (#113276) 2024-09-25 15:30:22 -05:00
inference [DOCS] Improves semantic text documentation. (#113606) 2024-09-26 16:09:28 +02:00
ingest Adds text_similarity task type to inference processor documentation (#113517) 2024-09-26 16:12:28 +02:00
licensing [DOCS] Remove testenv annotations from doc snippet tests (#80023) 2021-11-05 18:38:50 -04:00
mapping [DOCS] Improves semantic text documentation. (#113606) 2024-09-26 16:09:28 +02:00
migration Forward port release notes for v8.15.0 (#111714) 2024-08-08 18:10:39 +01:00
ml [ML] Add documentation for post calendar events API (#113188) 2024-09-24 09:46:42 +02:00
modules ESQL: Document esql_worker threadpool (#113203) 2024-09-23 11:03:37 -04:00
monitoring [Docs] Update Monitoring docs with integration assets info (#112164) 2024-09-04 16:07:45 -04:00
query-dsl fix a couple of docs typos (#112901) 2024-09-20 18:34:24 +03:00
query-rules/apis [Query rules] Add exclude query rule type (#111420) 2024-08-02 08:03:54 -04:00
quickstart [DOCS] Create Elasticsearch basics section, refactor quickstarts section (#112436) 2024-09-25 17:30:01 +02:00
release-notes Added known issue entry for synthetic source bug. (#113269) 2024-09-23 07:06:55 +02:00
repositories-metering-api [DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413) 2024-04-17 14:37:07 +02:00
reranking [DOCS] Fix reranking IA, move retrievers to search api overview (#112949) 2024-09-19 17:20:52 +02:00
rest-api [ML] Add deployment threading details and memory usage to telemetry (#113099) 2024-09-23 16:08:46 +01:00
rollup Revert "Emit deprecation warning when executing one of the rollup APIs (#112807)" (#113047) 2024-09-18 05:30:35 +10:00
scripting Aggs: Scripted metric allow list docs (#109635) 2024-07-11 14:27:51 +02:00
search [DOCS] Add snippet tests to retriever API docs (#113289) 2024-09-23 16:59:01 +02:00
search-application/apis Allow typed_keys for search application Search API (#108007) 2024-04-30 11:31:45 +02:00
searchable-snapshots Updates-warning-about-mounting-snapshots (#112057) 2024-08-22 12:22:32 +02:00
security (Doc+) Update example SAML blog for Okta (#112934) 2024-09-18 12:04:44 +02:00
settings fix typos (#113329) 2024-09-23 17:38:51 +02:00
setup Mention full-cluster restart in initial_master_node docs (#112986) 2024-09-19 10:41:39 +01:00
shutdown/apis [DOCS] Align docs to implementation for timeout parameters (#108593) 2024-05-16 13:05:39 +10:00
slm/apis Add interval based SLM scheduling (#110847) 2024-08-22 21:15:29 -05:00
snapshot-restore LogsDB data migration integration testing (#112710) 2024-09-17 16:26:48 +02:00
sql Removing server from the version compatibility table (#109168) 2024-05-29 11:57:46 -06:00
synonyms/apis Clarify synonyms docs (#110822) 2024-07-18 10:20:26 +02:00
tab-widgets [DOCS] Create Elasticsearch basics section, refactor quickstarts section (#112436) 2024-09-25 17:30:01 +02:00
text-structure/apis [DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413) 2024-04-17 14:37:07 +02:00
transform [DOCS] updates transforms at scale doc with date rounding. (#109073) 2024-05-27 16:34:01 +02:00
troubleshooting (Doc+) Avoid search pile up by setting default timeout (#112846) 2024-09-26 09:05:21 -06:00
upgrade (Doc+) Link Gateway Settings to Full Restart (#110902) 2024-07-25 09:10:19 -06:00
vectors Adds new bit element_type for dense_vectors (#110059) 2024-06-27 04:48:41 +10:00
watcher Deprecate legacy params from range query (#113286) 2024-09-25 14:48:45 -04:00
aggregations.asciidoc
alias.asciidoc Mention alias filters don't apply for get-by-id in docs (#108433) 2024-05-08 15:28:25 -06:00
analysis.asciidoc Update Lucene analysis base url (#84094) 2022-02-17 12:44:12 +01:00
api-conventions.asciidoc Add known issue docs for #111854 (#111978) 2024-08-20 07:25:55 +01:00
cat.asciidoc Add 'dataset' size to cat indices and cat shards (#98622) 2023-08-22 15:36:32 -06:00
cluster.asciidoc Fix voting_only:true in node spec docs (#99099) 2023-08-31 17:41:50 +01:00
data-management.asciidoc [DOCS] Update tech preview copy (#101606) 2023-10-31 10:31:07 -04:00
data-rollup-transform.asciidoc [DOCS] Deprecate rollups (#101265) 2023-10-25 16:52:25 -04:00
datatiers.asciidoc (Doc+) Flush out Data Tiers (#107981) 2024-07-18 14:35:41 -06:00
dependencies-versions.asciidoc [DOCS] Replace dependencies list with a link. Closes #84863 (#90694) 2022-11-09 14:37:55 -08:00
docs.asciidoc
geospatial-analysis.asciidoc Simple addition of ES|QL to geo overview page (#111158) 2024-07-23 12:00:05 +02:00
gs-index.asciidoc
high-availability.asciidoc [DOCS] Overhaul snapshot and restore docs (#79081) 2021-11-15 12:45:07 -05:00
how-to.asciidoc Add guide for tuning kNN search (#89782) 2022-10-12 14:53:53 -07:00
index-modules.asciidoc Remove zstd feature flag for index codec best compression. (#112665) 2024-09-13 10:49:49 +02:00
index.asciidoc [DOCS] Create Elasticsearch basics section, refactor quickstarts section (#112436) 2024-09-25 17:30:01 +02:00
index.x.asciidoc
indices.asciidoc Resolve Cluster API (#102726) 2024-02-08 10:50:05 -05:00
ingest.asciidoc [DOCS] [Enterprise Search] Migrate ingest pipelines/ML docs (#101156) 2023-10-25 17:17:24 +02:00
intro.asciidoc [DOCS] Create Elasticsearch basics section, refactor quickstarts section (#112436) 2024-09-25 17:30:01 +02:00
landing-page.asciidoc [DOCS] Create Elasticsearch basics section, refactor quickstarts section (#112436) 2024-09-25 17:30:01 +02:00
links.asciidoc
mapping.asciidoc [DOCS][101] Refine mappings + documents/indices overviews (#112545) 2024-09-10 12:17:10 +02:00
query-dsl.asciidoc Group vector queries into new section (#110722) 2024-07-11 14:45:35 +02:00
redirects.asciidoc [DOCS] Add ES quickstart (#102226) 2023-11-24 15:27:41 +01:00
release-notes.asciidoc Forward port release notes for v8.15.1 (#112568) 2024-09-16 17:21:38 +02:00
run-elasticsearch-locally.asciidoc [DOCS] Create Elasticsearch basics section, refactor quickstarts section (#112436) 2024-09-25 17:30:01 +02:00
scripting.asciidoc [DOCS] Add documentation for Painless field API (#83388) 2022-02-03 15:15:38 -05:00
search.asciidoc Add retrievers using the parser-only approach (#105470) 2024-03-12 10:11:55 -07:00
setup.asciidoc [DOCS] Create Elasticsearch basics section, refactor quickstarts section (#112436) 2024-09-25 17:30:01 +02:00
troubleshooting.asciidoc (Doc+) Capture Elasticsearch diagnostic (#108259) 2024-05-09 10:27:19 -06:00
upgrade.asciidoc [DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413) 2024-04-17 14:37:07 +02:00