fix: Gracefully handle malformed documents in result scanning - #5618
Conversation
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
…arch-project#5618) Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Description
In general, documents are validated by OpenSearch according to the mapping types at index time. However, this behavior can be bypassed via the
index.mapping.ignore_malformedsetting, which lets you index arbitrary data regardless of the mapping. This causes PPL to crash any time it encounters these documents.This PR adds a lot of handling around malformed documents, both at a per-field level (6 individual bad cases involving timestamp, geo, IP, and others) and at an overall level (if a document causes some sort of cascading failure not handled by the prev checks, then we log & skip).
Notes/future work:
Exceptions for field parsing, kinda aggressive but I think for our purposes it's always better to fail one field over failing a doc.Additionally tested:
where malformed_field is nullandis not nullin queries will work as expected.Related Issues
Internal ticket.
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.