[hotfix-#1952][core|doris] Fix ARRAY and LARGEINT type conversion exc…#1953
[hotfix-#1952][core|doris] Fix ARRAY and LARGEINT type conversion exc…#1953zhiqiang-dev wants to merge 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces configurable timezone support to fix ARRAY and LARGEINT type conversion exceptions in the Doris connector. The fix allows users to control whether date/timestamp operations use the system's local timezone or the default GMT+8 timezone via a system property.
- Adds
USE_LOCAL_TIMEZONEsystem property to control timezone behavior - Modifies
DateUtilto conditionally use local timezone or GMT+8 based on the system property - Maintains backward compatibility by defaulting to GMT+8 when the property is not set
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
|
||
| private static final String TIME_ZONE = "GMT+8"; | ||
|
|
||
| private static final boolean isUseLocalTimeZone = |
There was a problem hiding this comment.
The variable name isUseLocalTimeZone does not follow Java naming conventions for boolean variables. In Java, boolean variable names should not include "is" as a prefix when declared, since the getter method will add "is" automatically. The variable should be named useLocalTimeZone instead of isUseLocalTimeZone.
| private static final boolean isUseLocalTimeZone = | |
| private static final boolean useLocalTimeZone = |
| @@ -48,6 +48,9 @@ public class DateUtil { | |||
|
|
|||
| private static final String TIME_ZONE = "GMT+8"; | |||
|
|
|||
There was a problem hiding this comment.
The new system property USE_LOCAL_TIMEZONE lacks documentation. A comment should be added to explain:
- What this property does (controls timezone behavior for date/timestamp formatting)
- How to set it (as a JVM system property)
- Valid values (true/false)
- Default behavior when not set (uses GMT+8)
- The impact on date/timestamp conversions across the application
| /** | |
| * System property: USE_LOCAL_TIMEZONE | |
| * | |
| * Controls timezone behavior for date/timestamp formatting throughout the application. | |
| * | |
| * How to set: Pass as a JVM system property, e.g. -DUSE_LOCAL_TIMEZONE=true | |
| * Valid values: "true" or "false" (case-insensitive) | |
| * Default behavior: If not set or set to "false", uses GMT+8 as the default timezone. | |
| * If set to "true", uses the local system timezone for date/timestamp conversions. | |
| * | |
| * Impact: Affects how dates and timestamps are formatted and parsed across the application. | |
| * Setting this to "true" will use the system's local timezone, which may change the results | |
| * of date/timestamp conversions depending on the environment where the JVM is running. | |
| */ |
…eptions
Purpose of this pull request
Which issue you fix
Fixes # (issue).
Checklist: