Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove hybrid related logic #1172

Merged
merged 6 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion analytic_engine/src/compaction/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ mod tests {
max_sequence: 200,
schema: build_schema(),
parquet_filter: Default::default(),
collapsible_cols_idx: Vec::new(),
};

SstMetaData::Parquet(Arc::new(parquet_meta_data))
Expand Down
9 changes: 1 addition & 8 deletions analytic_engine/src/sst/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Factory for FactoryImpl {
};

match storage_format {
StorageFormat::Columnar | StorageFormat::Hybrid => {
StorageFormat::Columnar => {
let reader = AsyncParquetReader::new(
path,
options,
Expand All @@ -197,16 +197,9 @@ impl Factory for FactoryImpl {
store_picker: &'a ObjectStorePickerRef,
level: Level,
) -> Result<Box<dyn SstWriter + Send + 'a>> {
let hybrid_encoding = match options.storage_format_hint {
StorageFormatHint::Specific(format) => matches!(format, StorageFormat::Hybrid),
// `Auto` is mapped to columnar parquet format now, may change in future.
StorageFormatHint::Auto => false,
};

Ok(Box::new(ParquetSstWriter::new(
path,
level,
hybrid_encoding,
store_picker,
options,
)))
Expand Down
1 change: 0 additions & 1 deletion analytic_engine/src/sst/meta_data/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ mod tests {
max_sequence: 1001,
schema,
parquet_filter: None,
collapsible_cols_idx: vec![],
};
write_parquet_file_with_metadata(parquet_file_path.as_path(), &custom_meta_data);

Expand Down
18 changes: 2 additions & 16 deletions analytic_engine/src/sst/parquet/async_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ use crate::{
SstMetaData,
},
parquet::{
encoding::ParquetDecoder,
meta_data::{ParquetFilter, ParquetMetaDataRef},
row_group_pruner::RowGroupPruner,
encoding::ParquetDecoder, meta_data::ParquetFilter, row_group_pruner::RowGroupPruner,
},
reader::{error::*, Result, SstReader},
},
Expand Down Expand Up @@ -157,20 +155,12 @@ impl<'a> Reader<'a> {
ArrowRecordBatchProjector::from(row_projector)
};

let sst_meta_data = self
.meta_data
.as_ref()
// metadata must be inited after `init_if_necessary`.
.unwrap()
.custom();

let streams: Vec<_> = streams
.into_iter()
.map(|stream| {
Box::new(RecordBatchProjector::new(
stream,
row_projector.clone(),
sst_meta_data.clone(),
self.metrics.metrics_collector.clone(),
)) as _
})
Expand Down Expand Up @@ -474,14 +464,12 @@ struct RecordBatchProjector {

metrics: ProjectorMetrics,
start_time: Instant,
sst_meta: ParquetMetaDataRef,
}

impl RecordBatchProjector {
fn new(
stream: SendableRecordBatchStream,
row_projector: ArrowRecordBatchProjector,
sst_meta: ParquetMetaDataRef,
metrics_collector: Option<MetricsCollector>,
) -> Self {
let metrics = ProjectorMetrics {
Expand All @@ -494,7 +482,6 @@ impl RecordBatchProjector {
row_projector,
metrics,
start_time: Instant::now(),
sst_meta,
}
}
}
Expand All @@ -510,8 +497,7 @@ impl Stream for RecordBatchProjector {
match record_batch.box_err().context(DecodeRecordBatch {}) {
Err(e) => Poll::Ready(Some(Err(e))),
Ok(record_batch) => {
let parquet_decoder =
ParquetDecoder::new(&projector.sst_meta.collapsible_cols_idx);
let parquet_decoder = ParquetDecoder::new();
let record_batch = parquet_decoder
.decode_record_batch(record_batch)
.box_err()
Expand Down
Loading
Loading