Skip to main content

read_matching_rows

Function read_matching_rows 

Source
pub(crate) fn read_matching_rows(
    path: &Path,
    start_ns: i64,
    end_ns: i64,
) -> Result<MatchedFile>
Expand description

Reads the rows of one archived file whose timestamps fall in [start_ns, end_ns].

Row groups whose timestamp statistics lie entirely outside the range are skipped without being decoded, and the two columns are read with typed column readers instead of building a generic row object per sample. Column 0 must be the INT64 timestamp and column 1 the DOUBLE value, as in the archive schema. Calibration comes from read_calibration_from_metadata.

§Arguments

  • path - Parquet file to read.
  • start_ns - Inclusive range start, Unix nanoseconds.
  • end_ns - Inclusive range end, Unix nanoseconds.

§Returns

The matching rows in stored order, with the file’s calibration and its id.

§Errors

Returns an error if the file cannot be opened or parsed as Parquet, if a row group or column cannot be read, or if a row group has different numbers of timestamps and values.

§Panics

Panics if column 0 is not INT64 or column 1 is not DOUBLE (see read_column).