Skip to content

[Bug] Preserve typed DEFAULT_VALUE and struct userdata after JSON reload #3028

@dpol1

Description

@dpol1

Bug Type (问题类型)

logic (逻辑设计问题)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.7.0
  • Backend: schema metadata reload paths; not backend-specific
  • OS: N/A
  • Data Size: N/A

Expected & Actual behavior (期望与实际表现)

Expected

Userdata.DEFAULT_VALUE (~default_value) should preserve the expected runtime type after schema metadata is serialized and reloaded.

For example, a PropertyKey with DataType.DATE should reload its default value as java.util.Date, not as a generic JSON String.

Actual

Schema userdata is deserialized through raw Map / Object paths, so Jackson cannot infer the original runtime type.

For ~default_value, a Date default value can be serialized as a formatted string and later reloaded as String.

This may affect multiple schema reload paths, including:

  • SchemaMetaManager -> PropertyKey.fromMap(...)
  • JSON-based backend serializers such as Text/Binary/Table/Cassandra-style userdata reload paths
  • the mirror userdata model in hugegraph-struct

Possible fix direction

PropertyKey already knows its dataType, so ~default_value could be normalized after the PropertyKey is reconstructed, using the same conversion logic already used for property values.

Scope

  • Investigate Userdata.DEFAULT_VALUE reload behavior, especially for DataType.DATE.
  • Normalize confirmed typed default values after schema reload.
  • Check whether the same gap exists in hugegraph-struct.
  • Add regression tests for the confirmed reload path(s).

Vertex/Edge example (问题点 / 边数据举例)

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions