Making NormalizedDateSegmentNameGenerator use joda time to keep consistency other time handling#10721
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10721 +/- ##
============================================
+ Coverage 68.41% 70.20% +1.79%
- Complexity 6518 6529 +11
============================================
Files 2164 2164
Lines 116410 116412 +2
Branches 17609 17609
============================================
+ Hits 79637 81725 +2088
+ Misses 31136 28990 -2146
- Partials 5637 5697 +60
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 171 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
snleee
left a comment
There was a problem hiding this comment.
Thank you for quickly addressing this!
Can you add the testing case where the format works in joda while it's not working in java to cover this case?
Will do. Also I checked out the other references and it doesn't seem like they will be impacted by this case since they are formatting a constant string. |
…stency with other time handling in segment generation
cb726d8 to
37aef31
Compare
Context
For a Kafka ingestion use case, the time column was configured with a time format that was working as expected. But when configuring a minion task leveraging the SegmentProcessorFramework, a date format exception was thrown with the same exact time column/format:
Specifically the realtime ingestion was using
SegmentColumnarIndexCreator, which uses joda time DateFormatter for parsing time format into epoch millis (See SegmentColumnarIndexCreator).But the minion task was configured to use the
NormalizedDateSegmentNameGeneratorwhich failed since it uses another date time format library,java.textSimpleDateFormat. This library seems to be stricter that the joda time library and if a time column values has literal ‘Z’ in it, the time format must have theZin single quotes. E.g. "2023-01-01T12:00:00.111111111Z" needs a time format of "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS’Z’" otherwise it will fail.Changes
This PR makes the
NormalizedDateSegmentNameGeneratoralso use the joda date time formatter. Joda is no longer maintained andjava.textseems to be outdated. This PR aims to unify the time library until we are ready to make the switch to use the newerjava.timelibrary.Instructions:
featurebugfixperformanceuibackward-incompatrelease-notes(**)(*) Other labels to consider:
testingdependenciesdockerkubernetesobservabilitysecuritycode-styleextension-pointrefactorcleanup(**) Use
release-noteslabel for scenarios like: