Skip to content

Conversation

@jbaiera
Copy link
Member

@jbaiera jbaiera commented Jun 6, 2025

This PR introduces a new flag to ingest pipeline configurations which will be used to control how fields are accessed from within that pipeline.

The field_access_pattern config option is used to denote which strategy to use for resolving field names in ingest pipelines:

{
  "description": "My pipeline description",
  "field_access_pattern": "flexible",
  "processors": [...]
}

This config accepts two values currently:

  • classic - the default value and current behavior
  • flexible - defines the new field access behavior that will allow for dotted field name access

The configuration requires a new node feature to be present on all nodes in the cluster in order to be accepted. This node feature is only added to the cluster if the streams feature flag is enabled.

jbaiera added 3 commits June 6, 2025 14:59
Use the new java syntax they say. It'll be fine they say. COMPILER ERROR
@jbaiera jbaiera requested review from lukewhiting and masseyke June 6, 2025 21:56
@jbaiera jbaiera added >non-issue :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP labels Jun 6, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added Team:Data Management Meta label for data/management team v9.1.0 labels Jun 6, 2025
@lukewhiting lukewhiting requested a review from Copilot June 9, 2025 12:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new field_access_pattern option to ingest pipeline configs, introduces the corresponding enum and node feature, and propagates the flag through pipeline creation and execution.

  • Extend Pipeline.create and constructors to accept a hasFeature predicate and the new fieldAccessPattern
  • Introduce IngestPipelineFieldAccessPattern enum and register it via IngestFeatures/FeatureSpecification
  • Update all call sites, transport actions, and tests to pass the feature predicate and handle the new flag

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/validation/SourceDestValidatorTests.java Updated Pipeline.create invocation to include the new feature predicate.
server/src/test/java/org/elasticsearch/ingest/PipelineProcessorTests.java Adjusted test pipelines to include IngestPipelineFieldAccessPattern.CLASSIC.
server/src/test/java/org/elasticsearch/ingest/PipelineFactoryTests.java Expanded Pipeline.create calls and added tests for unsupported patterns.
server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestParsingTests.java Updated parse calls to accept a feature predicate lambda.
server/src/main/resources/META-INF/services/org.elasticsearch.features.FeatureSpecification Registered the new IngestFeatures spec to expose the node feature.
server/src/main/java/org/elasticsearch/ingest/TrackingResultProcessor.java Propagated fieldAccessPattern into the pipeline decoration.
server/src/main/java/org/elasticsearch/ingest/SimulateIngestService.java Passed the feature‐checking lambda into substitution pipeline creation.
server/src/main/java/org/elasticsearch/ingest/Pipeline.java Added FIELD_ACCESS_PATTERN constant, field, enum handling in create(), and a getter.
server/src/main/java/org/elasticsearch/ingest/IngestService.java Declared the FIELD_ACCESS_PATTERN node feature and local support check.
server/src/main/java/org/elasticsearch/ingest/IngestPipelineFieldAccessPattern.java Introduced enum to represent classic vs. flexible access patterns.
server/src/main/java/org/elasticsearch/ingest/IngestFeatures.java Implemented FeatureSpecification to advertise the feature.
server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineTransportAction.java Updated transport action to supply the feature predicate to parsing.
server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java Modified parse() signature to take a Predicate<NodeFeature>.
server/src/main/java/org/elasticsearch/action/ingest/SimulateExecutionService.java Propagated fieldAccessPattern into simulated pipeline execution.
server/src/main/java/module-info.java Added org.elasticsearch.ingest.IngestFeatures to the module declarations.
Comments suppressed due to low confidence (2)

server/src/main/java/org/elasticsearch/ingest/Pipeline.java:30

  • [nitpick] Update the class-level Javadoc for Pipeline to mention the new field_access_pattern configuration option and its effect, and document the getFieldAccessPattern() method so that users understand its purpose.
public final class Pipeline {

server/src/main/java/org/elasticsearch/ingest/TrackingResultProcessor.java:219

  • Add a unit test for TrackingResultProcessor verifying that the injected fieldAccessPattern is correctly passed through and applied during pipeline execution.
pipeline.getFieldAccessPattern(),

Copy link
Contributor

@lukewhiting lukewhiting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, tidy & super easy to follow. LGTM 👍🏻

String fieldAccessPatternRaw = ConfigurationUtils.readOptionalStringProperty(null, null, config, FIELD_ACCESS_PATTERN);
if (fieldAccessPatternRaw != null && hasFeature.test(IngestService.FIELD_ACCESS_PATTERN) == false) {
throw new ElasticsearchParseException(
"pipeline [" + id + "] doesn't support one or more provided configuration parameters [field_access_pattern]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor thing, but it's the node that doesn't support the parameter, not the pipeline, right? Also, it's always one, never "or more" since it's a hard-coded list of one right?

@masseyke
Copy link
Member

Looks good to me. I assume rest tests, documentation, and rest-spec changes (and probably other things I'm forgetting) are all coming once the new field does what it's supposed to do.

@masseyke
Copy link
Member

Oh, and it needs the 8.19.0 label, right?

@jbaiera jbaiera merged commit 2144bae into elastic:main Jul 1, 2025
32 checks passed
@jbaiera jbaiera deleted the streams-ingest-pipeline-field-access-flag branch July 1, 2025 19:50
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 2, 2025
This PR introduces a new flag to ingest pipeline configurations which will be used to control how 
fields are accessed from within that pipeline.
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 3, 2025
This PR introduces a new flag to ingest pipeline configurations which will be used to control how 
fields are accessed from within that pipeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >non-issue Team:Data Management Meta label for data/management team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants