morrySnow opened a new pull request, #69878:
URL: https://github.com/apache/doris/pull/69878
### What problem does this PR solve?
Issue Number: None
Related PR: #69876
Backport of #69876 to `branch-4.2`.
Problem Summary: Older FE versions can persist the enum name `TIME` in view
column schemas. After that enum was removed, Gson reads the name as null.
Restoring such a view from an image or a create-table journal leaves an invalid
column type, and `information_schema.columns` fails in `describeTables` when
converting the type to Thrift.
Add `TIME` as a deserialization alias of `PrimitiveType.TIMEV2` through
Gson's existing enum adapter. New metadata continues to serialize as `TIMEV2`.
Tests cover the enum and scalar type, ordinary and nested columns, current
precision preservation, and view recovery through both image and journal entry
points.
### Release note
Fix `information_schema.columns` queries failing after an upgrade when
existing view metadata contains the legacy TIME type.
### Check List (For Author)
- Test: Unit Test / Checkstyle
- `./run-fe-ut.sh --run
org.apache.doris.catalog.LegacyTimeTypeGsonCompatibilityTest,org.apache.doris.catalog.ColumnGsonSerializationTest`:
8 tests passed on dev-hk.
- The six new compatibility tests reproduce the failure on master before
the fix, including the original null-pointer exception on the image and journal
paths.
- `mvn checkstyle:check -pl fe-common,fe-core`: passed.
- Validation ran on the development branch; this PR replays the
identical fix and test class onto the current upstream branch-4.2 base.
- Behavior changed: Yes; persisted TIME is loaded as TIMEV2, while
serialization continues to write TIMEV2.
- Does this need documentation: No
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]