dosubot[bot] commented on issue #3028: URL: https://github.com/apache/hugegraph/issues/3028#issuecomment-4459082064
<!-- Answer --> Yes, this is a valid follow-up issue. Here's why: **The gap is real.** `Userdata.DEFAULT_VALUE` (`~default_value`) is defined in both `hugegraph-core` [[1]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/Userdata.java#L31) and `hugegraph-struct` [[2]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-struct/src/main/java/org/apache/hugegraph/struct/schema/Userdata.java#L31). `PropertyKey` stores default values in the userdata map via `defineDefaultValue()` / `defaultValue()` [[3]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/PropertyKey.java#L119-L124), and `PropertyKey.fromMap()` deserializes userdata — including `~default_value` — as raw `Map<String, Object>` [[4]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/huge graph-core/src/main/java/org/apache/hugegraph/schema/PropertyKey.java#L443-L483). This means a `DataType.DATE` default value will be reloaded as a `String`, exactly the same root cause as the `~create_time` bug in [#3013](https://github.com/apache/hugegraph/issues/3013#issuecomment-4380310057) [[5]](https://github.com/apache/hugegraph/issues/3013#issuecomment-4380310057). **Relationship to #3013.** Issue #3013 established that all backend serializers deserialize userdata into a raw `Map`, so formatted timestamps are never converted back to `Date`. The fix direction discussed there (normalizing in `SchemaElement.userdata(String, Object)`) would naturally cover `~create_time` but would **not** cover `~default_value`, because `~default_value`'s expected type depends on `PropertyKey.dataType()` rather than being unconditionally `Date`. That makes this a distinct follow-up requiring its own type-aware normalization step — likely in `PropertyKey.fromMap()` or `PropertyKey.defaultValue()` after the data type is known. **hugegraph-struct scope.** The `hugegraph-struct` module has its own parallel `Userdata` and `PropertyKey` classes [[6]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-struct/src/main/java/org/apache/hugegraph/struct/schema/Userdata.java) [[7]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-struct/src/main/java/org/apache/hugegraph/struct/schema/PropertyKey.java#L124-L129) used for distributed RPC communication [[8]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-struct/README.md#L5). If `hugegraph-struct`'s `PropertyKey` also deserializes from maps or JSON without type-aware normalization, the same gap would exist there as well. **Summary:** This is a valid, distinct follow-up to #3013 — same class of bug (userdata type loss on reload), but requires a different fix because the expected type of `~default_value` is dynamic (driven by `dataType`) rather than static. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fhugegraph).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fhugegraph). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fhugegraph&message_id=969f5cdd-5dfb-489b-95c8-ad31c7f2ab2b) [](https://github.dosu.com/apache/hugegraph?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fhugegraph) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fhugegraph) -- 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]
