-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Support Fields API in conditional ingest processors #121914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Fields API in conditional ingest processors #121914
Conversation
…ds-in-ingest-processors
…ds-in-ingest-processors
…ds-in-ingest-processors
…ds-in-ingest-processors
|
@elasticmachine test this please |
…ds-in-ingest-processors
…ds-in-ingest-processors
…ds-in-ingest-processors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start! I left some feedback for a few items that need to be looked at.
server/src/main/java/org/elasticsearch/ingest/ConditionalProcessor.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/script/SourceMapFieldScript.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/script/IngestConditionalScript.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/script/IngestConditionalScript.java
Outdated
Show resolved
Hide resolved
50c278c to
5a60385
Compare
|
@jdconrad I had a bit of a mess and had to force push, please review carefully. I went over it and it looks fine, but since it is a small one, better go over everything in details. |
|
The CI failures seem somewhat arbitrary lately, making it hard to tell what needs further investigation and what simply needs another build attempt. @jdconrad your assistance in this regard would be appreciated. The consistent failures are around the Serverless checks and some bwc tests. If you have any pointers on where to look or what to fix - that'd be great. |
|
Tests in BWC look unrelated -- there are a lot of ESQL tests failing there. A rebase should help. |
…ds-in-ingest-processors
…st-processors' into support-dotted-fields-in-ingest-processors
|
I will take another pass through this today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the iterations.
|
I've reproduced the exception in serverless locally, and what I have found is it's a serialization issue. If the script exception is not serialized then it gets sent directly back as x-content. However, if it is serialized, it gets wrapped in not serializable exception wrapper which is then sent back as a proxy for the script exception in x-content. This is happening because the unsupported operation exception isn't serializable which is thrown when the unmodifiable collection is written to. In serverless it is being serialized and in non-serverless is isn't. I assume this is due to the way the clusters for the tests are configued, but I haven't looked too closely into this. For now I would suggest that we check to make sure an exception comes back with the catch_bad_request parameter, but not check what the type of exception is. In the future, we may want to have Painless handle this specific exception in a different way or have elasticsearch exception add unsupported operation exception to its custom serialization list. |
…ds-in-ingest-processors
|
For sure this inconsistency should not hold this PR from being merged, so I will adjust my assertion.
If it's a matter of test clusters setup, fixing it is nice-to-have (really nice 🙂 ). |
|
This can potentially happen in just normal elasticsearch as well, but would require the requests to be serialized as part of the test cases. Either way this change still LGTM! |
…king * upstream/main: (91 commits) Mute org.elasticsearch.packaging.test.DockerTests test130JavaHasCorrectOwnership elastic#131369 Add exception logging when interrupted (elastic#131153) Mute org.elasticsearch.packaging.test.DockerTests test140CgroupOsStatsAreAvailable elastic#131372 Mute org.elasticsearch.packaging.test.DockerTests test070BindMountCustomPathConfAndJvmOptions elastic#131366 Mute org.elasticsearch.xpack.test.rest.XPackRestIT test {p0=ml/delete_expired_data/Test delete expired data with body parameters} elastic#131364 Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testSimilarityBetweenConstantVectorAndField {functionName=v_cosine similarityFunction=COSINE} elastic#131363 Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testDifferentDimensions {functionName=v_cosine similarityFunction=COSINE} elastic#131362 Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testSimilarityBetweenConstantVectors {functionName=v_cosine similarityFunction=COSINE} elastic#131361 Check SCORE_FUNCTION capability in VerifierTests (elastic#131352) Replace deprecated routingTable table call in tests (elastic#131005) [DOCS] Remove misused applies_to tag (elastic#131349) Adj ivf postings list building (elastic#130843) [Transform] Read metadata from Project State (elastic#131205) Add note on o11y to architecture guide (elastic#131291) Upgrade AWS Java SDK to 2.31.78 (elastic#131050) Support Fields API in conditional ingest processors (elastic#121914) ESQL - KNN function uses prefilters when pushed down to Lucene (elastic#131004) Add docs for ES|QL query logs (elastic#131287) Simplify `expectedFinalRegisterValue` computation (elastic#131274) Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=search/110_field_collapsing/field collapsing, inner_hits and maxConcurrentGroupRequests} elastic#131348 ...
This reverts commit a6f0f6f.
This PR separates the Field APIs into write and read and exposes only the read APIs for use within ingest conditional scripts.
Things to note: