Skip to content
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

Fix time validation when data type needs to be converted #9569

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

Jackie-Jiang
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang commented Oct 11, 2022

Move the time validation into a separate record transformer: TimeValidationTransformer with the following bugfixes/enhancements:

  • Before validating the time value, convert the data type properly
  • Handle exception when time format parsing fails
  • Disable time validation by default (consistent behavior with or without IngestionConfig, and the same as the old behavior before default enabled row based time validation was introduced in Refactor timeValueCheck for Pinot TableConfig #9349)
  • Add isNoOp() API to RecordTransformer so that no-op transformers can be skipped

_timeFormatSpec = dateTimeFieldSpec.getFormatSpec();
IngestionConfig ingestionConfig = tableConfig.getIngestionConfig();
if (ingestionConfig != null) {
_skipTimeValueCheck = !ingestionConfig.isRowTimeValueCheck();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the original flag here instead of doing !isRowTimeValueCheck

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm debating a little bit on having the default value as true, but checked with @xiangfu0 and I believe the default behavior of having row value check on is by mistake (different from the existing behavior), so I'll change it to use the original flag

@Jackie-Jiang Jackie-Jiang force-pushed the fix_time_validation branch 2 times, most recently from dc13fd4 to 7fff03f Compare October 12, 2022 07:00
@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2022

Codecov Report

Merging #9569 (3799b24) into master (6ab65f8) will decrease coverage by 6.07%.
The diff coverage is 81.81%.

@@             Coverage Diff              @@
##             master    #9569      +/-   ##
============================================
- Coverage     69.90%   63.83%   -6.08%     
- Complexity     4875     4895      +20     
============================================
  Files          1931     1881      -50     
  Lines        103117   100949    -2168     
  Branches      15654    15420     -234     
============================================
- Hits          72088    64438    -7650     
- Misses        25954    31785    +5831     
+ Partials       5075     4726     -349     
Flag Coverage Δ
integration1 ?
integration2 ?
unittests1 67.37% <81.81%> (+0.06%) ⬆️
unittests2 15.60% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ot/spi/config/table/ingestion/IngestionConfig.java 100.00% <ø> (ø)
...l/recordtransformer/TimeValidationTransformer.java 77.27% <77.27%> (ø)
.../local/recordtransformer/CompositeTransformer.java 84.61% <100.00%> (+1.28%) ⬆️
...t/local/recordtransformer/DataTypeTransformer.java 90.58% <100.00%> (-0.76%) ⬇️
...local/recordtransformer/ExpressionTransformer.java 89.23% <100.00%> (+0.16%) ⬆️
...ent/local/recordtransformer/FilterTransformer.java 56.52% <100.00%> (-2.57%) ⬇️
...ent/local/recordtransformer/RecordTransformer.java 100.00% <100.00%> (ø)
...cal/recordtransformer/SanitizationTransformer.java 100.00% <100.00%> (ø)
...ot/segment/spi/creator/SegmentGeneratorConfig.java 81.59% <100.00%> (+0.70%) ⬆️
...va/org/apache/pinot/core/routing/RoutingTable.java 0.00% <0.00%> (-100.00%) ⬇️
... and 460 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Jackie-Jiang Jackie-Jiang merged commit 2d520d4 into apache:master Oct 12, 2022
@Jackie-Jiang Jackie-Jiang deleted the fix_time_validation branch October 12, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants