You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by ch...@apache.org on 2025/10/21 08:29:12 UTC

(fory-site) branch main updated: 🔄 synced local 'docs/specification/' with remote 'docs/specification/'

This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 21ca119d1 🔄 synced local 'docs/specification/' with remote 'docs/specification/'
21ca119d1 is described below

commit 21ca119d1c128de6e0859588b5768f3903522bbd
Author: chaokunyang <sh...@gmail.com>
AuthorDate: Tue Oct 21 08:29:07 2025 +0000

    🔄 synced local 'docs/specification/' with remote 'docs/specification/'
---
 docs/specification/xlang_serialization_spec.md | 34 ++++++++++++++++++--------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/docs/specification/xlang_serialization_spec.md b/docs/specification/xlang_serialization_spec.md
index 4b562de27..7252f7bbf 100644
--- a/docs/specification/xlang_serialization_spec.md
+++ b/docs/specification/xlang_serialization_spec.md
@@ -815,28 +815,42 @@ nullable primitive field value:
 +-----------+---------------+
 | null flag |  field value  |
 +-----------+---------------+
-field value of final type with ref tracking:
+other interal types supported by fory
 | var bytes | var objects |
 +-----------+-------------+
-| ref meta  | value data  |
+| null flag | value data  |
 +-----------+-------------+
-field value of final type without ref tracking:
+list field type:
 | one byte  | var objects |
 +-----------+-------------+
-| null flag | field value |
+| ref meta  | value data  |
+set field type:
+| one byte  | var objects |
 +-----------+-------------+
-field value of non-final type with ref tracking:
-| one byte  | var bytes | var objects |
-+-----------+-------------+-------------+
-| ref meta  | type meta  | value data  |
+| ref meta  | value data  |
+map field type:
+| one byte  | var objects |
++-----------+-------------+
+| ref meta  | value data  |
 +-----------+-------------+-------------+
-field value of non-final type without ref tracking:
+other types such as enum/struct/ext
 | one byte  | var bytes | var objects |
 +-----------+------------+------------+
-| null flag | type meta | value data |
+| ref  flag | type meta | value data |
 +-----------+------------+------------+
 ```
 
+Type hash algorithm:
+
+- Sort fields by fields sort algorithm
+- Start with string `""`
+- Iterate every field, append string by:
+  - `snow_case(field_name),`. For camelcase name, convert it to snow_case first.
+  - `$type_id,`, for other fields, use type id `TypeId::UNKNOWN` instead.
+  - `$nullable;`, `1` if nullable, `0` otherwise.
+- Then convert string to utf8 bytes
+- Compute murmurhash3_x64_128, and use first 32 bits
+
 #### Schema evolution
 
 Schema evolution have similar format as schema consistent mode for object except:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org