Skip to main content

compute_tsid_array

Function compute_tsid_array 

Source
pub fn compute_tsid_array(
    batch: &RecordBatch,
    sorted_tag_columns: &[TagColumnInfo],
    tag_arrays: &[&StringArray],
) -> UInt64Array
Expand description

Computes the TSID for each row in a [RecordBatch].

The TSID is a stable hash of the set of labels (tags) present in each row. It accounts for both the names and values of all non-null tag columns.

ยงLogic

  • If a row has no nulls across all sorted_tag_columns, it uses a precomputed hash of all label names.
  • If a row has nulls, it dynamically computes a hash of the names of labels that are present (non-null).
  • In both cases, it then hashes the values of those present labels in the order specified by sorted_tag_columns.