Skip to content

[fix](parse) No longer throws exceptions when parse datetime failed in from_olap_string#63035

Merged
zclllyybb merged 1 commit intoapache:masterfrom
zclllyybb:default_zonemap_dt
May 8, 2026
Merged

[fix](parse) No longer throws exceptions when parse datetime failed in from_olap_string#63035
zclllyybb merged 1 commit intoapache:masterfrom
zclllyybb:default_zonemap_dt

Conversation

@zclllyybb
Copy link
Copy Markdown
Contributor

Problem Summary: SerDe from_olap_string, from_fe_string, and from_zonemap_string handled invalid scalar strings inconsistently: some supported types returned errors while others filled default fields. This change makes supported string deserialization paths fill type defaults consistently on parse failure.

ATTN: We used to write some values in zonemap that were considered unreasonable after upgrading to later versions, as these values were actually not used (mostly just placeholders in partial updates or something). The only reasonable approach was to ignore them.

Copilot AI review requested due to automatic review settings May 6, 2026 14:19
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@zclllyybb
Copy link
Copy Markdown
Contributor Author

/review 额外关注一下异常测试是否充足

Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@zclllyybb
Copy link
Copy Markdown
Contributor Author

run buildall

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review completed for the actual PR diff (SerDe files and OlapTypeTest). I did not find blocking issues.

Critical checkpoints:

  • Goal/test coverage: the PR consistently changes supported scalar from_olap_string/from_fe_string/from_zonemap_string parse failures to return type defaults, with BE unit coverage across numeric/date/time/decimal/IP/bitmap/HLL/quantile/string paths.
  • Scope: the actual GitHub PR diff is focused on BE SerDe behavior and tests.
  • Concurrency/lifecycle: not applicable; no shared mutable state or lifecycle changes.
  • Compatibility/persistence: no serialized layout/protocol change; behavior change is explicitly called out in the PR.
  • Parallel code paths: default from_fe_string/from_zonemap_string delegate to from_olap_string, and changed overridden SerDes are covered.
  • Negative/exception tests: focus point checked. The new invalid-input test covers broad parse-failure cases; I did not find an additional missing exception-test issue for this PR.
  • Performance/observability: no meaningful hot-path regression or observability gap identified.

Comment thread be/src/core/data_type_serde/data_type_bitmap_serde.cpp
Comment thread be/src/core/data_type_serde/data_type_date_or_datetime_serde.cpp
Comment thread be/src/core/data_type_serde/data_type_decimal_serde.cpp Outdated
Comment thread be/src/core/data_type_serde/data_type_ipv4_serde.cpp Outdated
Comment thread be/src/core/data_type_serde/data_type_date_or_datetime_serde.cpp
Comment thread be/src/core/data_type_serde/data_type_ipv6_serde.cpp Outdated
Comment thread be/src/core/data_type_serde/data_type_timestamptz_serde.cpp Outdated
@zclllyybb zclllyybb force-pushed the default_zonemap_dt branch 2 times, most recently from 091f1fd to d66adef Compare May 7, 2026 05:12
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: DateV1/DateTimeV1 Field string deserialization returned an error for invalid OLAP strings while DateV2/DateTimeV2 already fell back to the type minimum for the same storage string paths. This change limits the fallback behavior to datelike types and keeps non-datelike parse failures as errors.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - ./run-be-ut.sh --run --filter=OlapTypeTest.*
- Behavior changed: Yes. Invalid DateV1/DateTimeV1 values passed through from_olap_string/from_fe_string/from_zonemap_string now produce the datelike minimum, matching DateV2/DateTimeV2; non-datelike invalid strings still return errors.
- Does this need documentation: No
@zclllyybb zclllyybb force-pushed the default_zonemap_dt branch from d66adef to 2f194d5 Compare May 7, 2026 10:07
@zclllyybb
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Summary: I found one blocking correctness issue. The remaining fallback is documented as a zonemap/partial-update workaround, but the PR also changes and tests from_fe_string to accept invalid datelike input. That path is used for FE-provided delete conditions, schema-change defaults, and default-value column iteration, so invalid user/configured DATE/DATETIME strings can silently become FIRST_DAY/MIN_DATE_V2 instead of failing.

Critical checkpoints:

  • Goal/test: The PR aims to tolerate invalid datelike zonemap strings; tests cover fallback behavior, but they also assert fallback for from_fe_string, which is outside that goal.
  • Scope: The change is not sufficiently focused because the fallback is implemented in from_olap_string, the shared backend for both from_zonemap_string and from_fe_string.
  • Concurrency/lifecycle/config: No new concurrency, special lifecycle, or configuration concerns found.
  • Compatibility/storage: No serialized format change found; existing corrupted/placeholder zonemap strings can be read, but FE string parsing semantics are broadened incorrectly.
  • Parallel paths: DateV1/DateTimeV1/DateV2/DateTimeV2 are handled consistently, but the FE-vs-zonemap caller distinction is not preserved.
  • Tests: Added BE UT coverage exists, but it codifies the incorrect from_fe_string behavior and lacks a negative assertion that FE/user strings still fail.
  • Observability/performance/transactions: No new observability, performance, or transaction issues identified in this small SerDe change.

User focus: No additional user-provided review focus was supplied.

Comment thread be/test/storage/olap_type_test.cpp
@zclllyybb
Copy link
Copy Markdown
Contributor Author

run buildall

@zclllyybb zclllyybb added the p0_w label May 7, 2026
@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

PR approved by at least one committer and no changes requested.

@zclllyybb
Copy link
Copy Markdown
Contributor Author

run beut

@zclllyybb zclllyybb changed the title [fix](parse) No longer throws exceptions when parse failed in from_olap_string [fix](parse) No longer throws exceptions when parse datetime failed in from_olap_string May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

PR approved by anyone and no changes requested.

@zclllyybb zclllyybb merged commit 333e33d into apache:master May 8, 2026
33 of 34 checks passed
@zclllyybb zclllyybb deleted the default_zonemap_dt branch May 8, 2026 07:28
github-actions Bot pushed a commit that referenced this pull request May 8, 2026
…n `from_olap_string` (#63035)

Problem Summary: SerDe from_olap_string, from_fe_string, and
from_zonemap_string handled invalid scalar strings inconsistently: some
supported types returned errors while others filled default fields. This
change makes supported string deserialization paths fill type defaults
consistently on parse failure.

ATTN: We used to write some values in zonemap that were considered
unreasonable after upgrading to later versions, as these values were
actually not used (mostly just placeholders in partial updates or
something). The only reasonable approach was to ignore them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.x dev/4.0.x-conflict dev/4.1.x p0_w reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants