Function izihawa_tantivy_columnar::merge_columnar

source ·
pub fn merge_columnar(
    columnar_readers: &[&ColumnarReader],
    required_columns: &[(String, ColumnType)],
    merge_row_order: MergeRowOrder,
    output: &mut impl Write
) -> Result<()>
Expand description

Merge several columnar table together.

If several columns with the same name are conflicting with the numerical types in the input columnars, the first type compatible out of i64, u64, f64 in that order will be used.

require_columns makes it possible to ensure that some columns will be present in the resulting columnar. When a required column is a numerical column type, one of two things can happen:

  • If the required column type is compatible with all of the input columnar, the resulsting merged columnar will simply coerce the input column and use the required column type.
  • If the required column type is incompatible with one of the input columnar, the merged will fail with an InvalidData error.

merge_row_order makes it possible to remove or reorder row in the resulting Columnar table.

Reminder: a string and a numerical column may bare the same column name. This is not considered a conflict.