wardenclyffe 0.1.1

A tiny Rust query engine that supports SQL-like filters, CSV scanning, projections, and a custom DSL powered by Pest.
Documentation
use std::fs::File;
use arrow::record_batch::RecordBatch;
use parquet::arrow::arrow_reader::ParquetRecordBatchReader;

pub struct ParquetSource {
    pub reader: ParquetRecordBatchReader,
}

impl ParquetSource {
    pub fn new(path: &str) -> Self {
        let file = File::open(path).expect("Unable to open parquet file");
        let reader = ParquetRecordBatchReader::try_new(file, 2048)
            .expect("Failed to create ParquetRecordBatchReader");
        Self { reader }
    }

    pub fn batches(&mut self) -> impl Iterator<Item = RecordBatch> + '_ {
        self.reader.by_ref().map(|batch| batch.expect("Error reading parquet batch"))
    }
}