Skip to content

Conversation

@zhiqiang-dev
Copy link
Contributor

…eptions

Purpose of this pull request

Which issue you fix

Fixes # (issue).

Checklist:

  • I have executed the 'mvn spotless:apply' command to format my code.
  • I have a meaningful commit message (including the issue id, the template of commit message is '[label-type-#issue-id][fixed-module] a meaningful commit message.')
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have checked my code and corrected any misspellings.
  • My commit is only one. (If there are multiple commits, you can use 'git squash' to compress multiple commits into one.)

@github-actions github-actions bot removed the DORIS label Dec 1, 2025
@zhiqiang-dev zhiqiang-dev self-assigned this Dec 1, 2025
Copilot finished reviewing on behalf of zhiqiang-dev December 1, 2025 10:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_TIMEZONE system property to control timezone behavior
  • Modifies DateUtil to 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 =
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
private static final boolean isUseLocalTimeZone =
private static final boolean useLocalTimeZone =

Copilot uses AI. Check for mistakes.
public class DateUtil {

private static final String TIME_ZONE = "GMT+8";

Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

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
Suggested change
/**
* 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.
*/

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants