Skip to main content

json_fields_compatible

Function json_fields_compatible 

Source
fn json_fields_compatible(expected_field: &Field, actual_field: &Field) -> bool
Expand description

Returns true when two fields are semantically equivalent JSON columns.

A JSON column is carried on the wire in its binary-encoded form (e.g. Binary + ARROW:extension:name=greptime.json / greptime:type=Json) and, after decoding on the remote side, in a concretized structured form (e.g. Struct(...) / List(...) carrying the same extension metadata). Both forms describe the same column, so the raw arrow data type must not be compared directly. The JSON extension identity (greptime:type) and the JSON2 settings (ARROW:extension:metadata, e.g. type hints) are the semantic parts of the field and must match.