-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add empty_value parameter to CSV processor #51567
Add empty_value parameter to CSV processor #51567
Conversation
This change adds `empty_value` parameter to the CSV processor. This value is used to fill empty fields. Fields will be skipped if this parameter is ommited. This behavior is the same for both quoted and unquoted fields.
Pinging @elastic/es-core-features (:Core/Features/Ingest) |
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
I also tested it in conjunction with #51492 and elastic/kibana#56038 and confirmed that the end-to-end import process now works with CSV files that have quoted empty fields and also those that have unquoted empty fields. 🎉
@@ -158,7 +218,7 @@ public void testEmptyFields() throws Exception { | |||
items.keySet().stream().skip(numItems - 1).forEach(key -> assertFalse(ingestDocument.hasField(key))); | |||
} | |||
|
|||
public void testWrongStings() throws Exception { | |||
public void testWrongStings() { |
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.
typo: Sting
-> String
(But it was there before and you've got a green build so if no other changes are required then no need to trigger a rebuild just for this.)
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.
One quick suggestion for the docs, but otherwise LGTM
@elasticmachine update branch |
@elasticmachine update branch |
* Add empty_value parameter to CSV processor This change adds `empty_value` parameter to the CSV processor. This value is used to fill empty fields. Fields will be skipped if this parameter is ommited. This behavior is the same for both quoted and unquoted fields. * docs updated * Fix compilation problem Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This change adds
empty_value
parameter to the CSV processor.This value is used to fill empty fields. Fields will be skipped
if this parameter is omitted. This behavior is the same for both
quoted and unquoted fields.