Fix CSVReaderBase validation, split, timestamp, and progress bugs#3771
Draft
arthurianresolve wants to merge 4 commits into
Draft
Fix CSVReaderBase validation, split, timestamp, and progress bugs#3771arthurianresolve wants to merge 4 commits into
arthurianresolve wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CSVReaderBaseandCSVRecordReaderregression coverageFixes Bug (CSVReaderBase) - missing required fields are not detected in name-value mode #3767.
Fixes Bug (CSVReaderBase) - skip header row skips data on non-first splits #3772.
Fixes Bug (CSVReaderBase) - default event timestamp uses ingest time #3773.
Fixes Bug (CSVReaderBase) - progress can be invalid for zero-length splits #3774.
Implementation commits
3a6dc3ad0- Fix CSVReaderBase required field validation (#3767)24a84e53f- Fix CSVReaderBase header skipping on splits (#3772)546fed550- Fix CSVReaderBase default file timestamp (#3773)66108b5f3- Fix CSVReaderBase progress for zero-size splits (#3774)Root cause and impact
CSVReaderBase.checkField(...)only checked required fields when a field was present and processed. In name=value mode, a required field that was absent from the input never reachedcheckField(...), so noMISSING_DATA_ERRORwas added. The fix tracks field names processed for each event, compares them with the configured required fields, and reports any required field that was not present. Existing empty-value validation remains incheckField(...).CSVReaderBase.nextKeyValue()skipped a row whenever the reader-local counter was0andskipHeaderRowwas enabled. On a laterFileSplit, that counter also starts at0, so the first data row assigned to that split could be dropped. The fix records whether the split starts at byte0and only applies header skipping to the first split.CSVReaderBase.initialize(...)set the default event timestamp fromSystem.currentTimeMillis(). That made events without configured event-date fields depend on ingest time instead of the source file timestamp already captured byLongLineEventRecordReader. The fix uses the raw input file timestamp when available and only falls back to current time if no file timestamp is present.CSVReaderBase.getProgress()divided bytotalSizewithout handling zero or empty splits. That could produce invalid progress values. The fix returns0ffor zero-size splits and keeps the existing upper bound of1ffor normal splits.Test
mvn --batch-mode --errors --no-transfer-progress -Dmaven.build.cache.enabled=false -pl warehouse/ingest-csv -am -Dtest=CSVReaderBaseTest,CSVRecordReaderRequiredFieldsTest,ExtendedCSVHelperTest,NormalizedContentInterfaceTest -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -DskipFormat testResult: BUILD SUCCESS across 25 reactor projects in 49.251 s.
CSVReaderBaseTest: 3 tests, 0 failures, 0 errors, 0 skippedCSVRecordReaderRequiredFieldsTest: 2 tests, 0 failures, 0 errors, 0 skippedExtendedCSVHelperTest: 1 test, 0 failures, 0 errors, 0 skippedNormalizedContentInterfaceTest: 3 tests, 0 failures, 0 errors, 0 skippedgit diff --check origin/integration..HEAD: passes