dosubot[bot] commented on issue #3013: URL: https://github.com/apache/hugegraph/issues/3013#issuecomment-4380327562
<!-- Answer --> Agreed on centralizing the fix. The good news is that all four serializers (Text, Binary, MySQL, Cassandra) converge on calling `SchemaElement.userdata(String key, Object value)` for each deserialized entry [[1]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/SchemaElement.java#L99-L103). That single-key setter is the natural place to add normalization — something like: ```java public SchemaElement userdata(String key, Object value) { E.checkNotNull(key, "userdata key"); E.checkNotNull(value, "userdata value"); if (Userdata.CREATE_TIME.equals(key) && value instanceof String) { value = DateUtil.parse((String) value); } this.userdata.put(key, value); return this; } ``` This avoids touching each serializer independently and covers all backend paths in one place. The `Userdata` class itself just extends `HashMap<String, Object>` [[2]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/Userdata.java#L26) with no instance-level normalization, so the `SchemaElement` setter is the better location. One consideration: if other internal userdata keys are added in the future with non-primitive types, this pattern could be extended to a small normalization registry rather than growing into a chain of `if` statements. <!-- 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=7a2f0535-57dc-4d89-9582-eb804b444ddb) [](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]
