questdb/arrow_metadata.rs
1//! Transport-neutral Arrow field-metadata keys, shared by both the ingress
2//! Arrow encoder (`RecordBatch` → `Buffer`) and the egress Arrow adapter
3//! (`Cursor` → `RecordBatch`). Lives here — rather than under `egress::arrow`
4//! — so a sender-only `arrow-ingress` build can reference the keys without
5//! pulling in the egress reader. This top-level module is the canonical public
6//! home for metadata used by either direction.
7//!
8//! These keys are written into the `Arc<Field>` of every column the client
9//! emits, and read back by `classify` on ingress and by mid-stream drift
10//! detection (`schemas_equal`).
11
12/// Carries the QuestDB native column type when the Arrow type
13/// alone is ambiguous (e.g. `Int8` → `byte`, `UInt16` → `char`).
14pub const COLUMN_TYPE: &str = "questdb.column_type";
15/// `"true"` on the field that is the table's designated timestamp.
16/// Informational only — not load-bearing for drift detection.
17pub const DESIGNATED_TIMESTAMP: &str = "questdb.designated_timestamp";
18/// `"asc"` / `"desc"`. Informational only.
19pub const DESIGNATED_TIMESTAMP_ORDER: &str = "questdb.designated_timestamp_order";
20/// Geohash precision in bits (1..=60). Required when the QuestDB
21/// native column kind is `geohash*`.
22pub const GEOHASH_BITS: &str = "questdb.geohash_bits";
23/// Marks a UTF-8 / dictionary column as the QuestDB `SYMBOL` kind.
24pub const SYMBOL: &str = "questdb.symbol";
25/// Native ARRAY dimensionality.
26pub const ARRAY_DIM: &str = "questdb.array_dim";
27/// `"true"` when `ARRAY_DIM` is a placeholder from an empty batch;
28/// drift detection accepts any opposite ndim until firmed up.
29pub const ARRAY_DIM_TENTATIVE: &str = "questdb.array_dim_tentative";
30/// Standard Apache Arrow extension-name field-metadata key.
31pub const ARROW_EXTENSION_NAME: &str = "ARROW:extension:name";
32/// Value used in [`ARROW_EXTENSION_NAME`] to mark a
33/// `FixedSizeBinary(16)` column as the canonical Arrow UUID.
34pub const EXT_ARROW_UUID: &str = "arrow.uuid";