You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "JackieTien97 (via GitHub)" <gi...@apache.org> on 2025/08/27 08:18:44 UTC
[PR] Fix DateTimeUtils init order bug [iotdb]
JackieTien97 opened a new pull request, #16285:
URL: https://github.com/apache/iotdb/pull/16285
This pull request refactors how timestamp precision is handled throughout the codebase, moving from static final variables to dynamic configuration and initialization. The main goal is to ensure that changes to timestamp precision in configuration are correctly reflected at runtime, improving flexibility and correctness. The changes also introduce getter methods for timestamp extraction functions and update related usages.
**Dynamic timestamp precision handling and initialization:**
* Refactored `DateTimeUtils` to replace static final variables (e.g., `TIMESTAMP_PRECISION`, extraction functions) with dynamically-initialized fields and added an `initTimestampPrecision()` method to update precision and related functions at runtime. Getter methods for extraction functions were also introduced. [[1]](diffhunk://#diff-d293044a0e71ea2351513a8ed6e20190e1ed1596c2757c42fe179126d7ee1dfcL62-R66) [[2]](diffhunk://#diff-d293044a0e71ea2351513a8ed6e20190e1ed1596c2757c42fe179126d7ee1dfcL83-R145) [[3]](diffhunk://#diff-d293044a0e71ea2351513a8ed6e20190e1ed1596c2757c42fe179126d7ee1dfcL790-R820) [[4]](diffhunk://#diff-d293044a0e71ea2351513a8ed6e20190e1ed1596c2757c42fe179126d7ee1dfcL927-R952)
* Updated all usages of timestamp precision and extraction functions in `PlanGraphPrinter`, `DateBinFunctionColumnTransformer`, and `ExtractTransformer` to use the new dynamic approach and getter methods instead of static constants. [[1]](diffhunk://#diff-2c4ba0e66962931f88ae3e7baeae36cf2f35dc9565a3f0fa4e8fe550deac81dfL840-R843) [[2]](diffhunk://#diff-6305624a6309fe575824478b8010ec68c38ebb22f777661699ef252c89f378b0L65-R64) [[3]](diffhunk://#diff-6305624a6309fe575824478b8010ec68c38ebb22f777661699ef252c89f378b0L80-R81) [[4]](diffhunk://#diff-6305624a6309fe575824478b8010ec68c38ebb22f777661699ef252c89f378b0L92-R93) [[5]](diffhunk://#diff-6305624a6309fe575824478b8010ec68c38ebb22f777661699ef252c89f378b0L101-R119) [[6]](diffhunk://#diff-a0cccdced4aa4317fe4133e48dafd797198e9f004ffc7e81d8a835ca281a18eaL34-R37) [[7]](diffhunk://#diff-a0cccdced4aa4317fe4133e48dafd797198e9f004ffc7e81d8a835ca281a18eaL75-R79)
**Initialization and configuration:**
* Ensured that `initTimestampPrecision()` is called during system configuration initialization in `DataNode`, guaranteeing that the timestamp precision and related functions are set up correctly at startup. [[1]](diffhunk://#diff-61bde9bbfe133b3e02f980faa06010a7f1dd5ea7f7417bd0bcad6375727878efR140) [[2]](diffhunk://#diff-61bde9bbfe133b3e02f980faa06010a7f1dd5ea7f7417bd0bcad6375727878efR396-R398)
**Imports and code cleanup:**
* Updated imports in affected files to reflect the new approach, removing unused static imports and adding necessary ones for the new methods. [[1]](diffhunk://#diff-2c4ba0e66962931f88ae3e7baeae36cf2f35dc9565a3f0fa4e8fe550deac81dfR23) [[2]](diffhunk://#diff-2c4ba0e66962931f88ae3e7baeae36cf2f35dc9565a3f0fa4e8fe550deac81dfL102) [[3]](diffhunk://#diff-6305624a6309fe575824478b8010ec68c38ebb22f777661699ef252c89f378b0R22) [[4]](diffhunk://#diff-6305624a6309fe575824478b8010ec68c38ebb22f777661699ef252c89f378b0L35-L36)
These changes improve the maintainability and correctness of timestamp handling, making the system more robust to configuration changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix DateTimeUtils init order bug [iotdb]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16285:
URL: https://github.com/apache/iotdb/pull/16285#issuecomment-3227573495
## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/16285?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `25.53191%` with `35 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 38.89%. Comparing base ([`b1ab9b3`](https://app.codecov.io/gh/apache/iotdb/commit/b1ab9b3eb978dfc5c7112d99eca4781ee66dfe5a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`c8d7072`](https://app.codecov.io/gh/apache/iotdb/commit/c8d7072a4efafe1a4090c49cc11a0f48e1dc5854?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/iotdb/pull/16285?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [.../java/org/apache/iotdb/db/utils/DateTimeUtils.java](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Futils%2FDateTimeUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvdXRpbHMvRGF0ZVRpbWVVdGlscy5qYXZh) | 30.00% | [21 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...unary/scalar/DateBinFunctionColumnTransformer.java](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Ftransformation%2Fdag%2Fcolumn%2Funary%2Fscalar%2FDateBinFunctionColumnTransformer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvdHJhbnNmb3JtYXRpb24vZGFnL2NvbHVtbi91bmFyeS9zY2FsYXIvRGF0ZUJpbkZ1bmN0aW9uQ29sdW1uVHJhbnNmb3JtZXIuamF2YQ==) | 33.33% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ngine/plan/planner/plan/node/PlanGraphPrinter.java](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fplanner%2Fplan%2Fnode%2FPlanGraphPrinter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9wbGFubmVyL3BsYW4vbm9kZS9QbGFuR3JhcGhQcmludGVyLmphdmE=) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...on/dag/column/unary/scalar/ExtractTransformer.java](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Ftransformation%2Fdag%2Fcolumn%2Funary%2Fscalar%2FExtractTransformer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvdHJhbnNmb3JtYXRpb24vZGFnL2NvbHVtbi91bmFyeS9zY2FsYXIvRXh0cmFjdFRyYW5zZm9ybWVyLmphdmE=) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ain/java/org/apache/iotdb/db/service/DataNode.java](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fservice%2FDataNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvc2VydmljZS9EYXRhTm9kZS5qYXZh) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #16285 +/- ##
============================================
- Coverage 38.90% 38.89% -0.01%
Complexity 198 198
============================================
Files 4894 4894
Lines 320632 320651 +19
Branches 40562 40561 -1
============================================
+ Hits 124730 124733 +3
- Misses 195902 195918 +16
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/iotdb/pull/16285?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix DateTimeUtils init order bug [iotdb]
Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #16285:
URL: https://github.com/apache/iotdb/pull/16285
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix DateTimeUtils init order bug [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16285:
URL: https://github.com/apache/iotdb/pull/16285#issuecomment-3231571610
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16285) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16285&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16285&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16285&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16285&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16285&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16285)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix DateTimeUtils init order bug [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16285:
URL: https://github.com/apache/iotdb/pull/16285#issuecomment-3227427464
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16285) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16285&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16285&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16285&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16285&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16285&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16285)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix DateTimeUtils init order bug [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16285:
URL: https://github.com/apache/iotdb/pull/16285#issuecomment-3227269390
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16285) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16285&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16285&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16285&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16285&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16285&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16285)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org