ES|QL: Adding USER_AGENT command#144384
Conversation
|
Hi @eyalkoren, I've created a changelog YAML for you. |
🔍 Preview links for changed docs |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
… esql-user_agent-command
… esql-user_agent-command
ncordon
left a comment
There was a problem hiding this comment.
Thanks for addressing my comments 🤗
…rics * upstream/main: (428 commits) ESQL: DS: Add inference/RERANK tests (elastic#145229) Unmute MMR logical plan test (elastic#145311) Do not attempt marking store as corrupted if the check is rejected due to shutdown (elastic#145209) feat(tsdb): add pipeline runtime and rename stage interfaces (elastic#145175) Fix UnresolvedException on PromQL by(step) grouping (elastic#145307) ES|QL: Optimize MMR by reducing cache size and lookup (elastic#145014) Prometheus labels/series APIs: support multiple match[] selectors (elastic#145298) Move ClientScrollablePaginatedHitSource into Reindex Module (elastic#144100) mute test class for elastic#145277 CPS mode for ViewResolver (elastic#145219) [ESQL] Disables GroupedTopNBenchmark temporarily (elastic#145124) Make exponential_histogram the default histogram type for HTTP OTLP endpoint (elastic#145065) More tests requiring an explicit confidence interval (elastic#145232) ES|QL: Adding `USER_AGENT` command (elastic#144384) ESQL: enable Generative IT after more fixes (elastic#145112) Rework FieldMapper parameter tests to not use merge builders (elastic#145213) [ESQL] Fix ORC type support gaps (elastic#145074) [Test] Unmute FollowingEngineTests.testProcessOnceOnPrimary (elastic#145192) Add PrometheusSeriesRestAction for /_prometheus/api/v1/series endpoint (elastic#144494) Prometheus labels API: add rest action (elastic#144952) ...
Closes #134886
Relies on the infrastructure that was introduced in #140712
Notes for reviewer
Column pruning via properties and
extract_device_typeat logical-plan creationThe properties and
extract_device_typeconfig options are resolved into the concrete set of output field names at the coordinator, insideLogicalPlanBuilder.visitUserAgentCommand(), before the logical plan node is even created. TheUserAgentlogical plan node receives only the already-filteredoutputFieldNames— it has no awareness of properties at all. This means unrequested columns are never created, never serialized, and never allocated on data nodes.Details object allocation per row is acceptable
Unlike
URI_PARTSandREGISTERED_DOMAIN, where the bridge'sevaluate()can write primitive values directly from the parsed result without intermediate allocations, theUserAgentParser.parseUserAgentInfo()API always returns aDetailsrecord (which itself containsVersionedNamerecords for OS and device).This does NOT represent a per-row allocation concern because results are served from a cache:
UserAgentParserimplementation maintains an internal LRU cache keyed by user-agent string. On cache hit, the previously allocatedDetailsobject is returned directly — no new allocation.DetailsandVersionedNameallocations are negligible compared to the regex parsing cost, and they must exist anyway because the result needs to be cached for future lookups.