Skip to content

Commit

Permalink
refactor: remove redundant code (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jun 25, 2023
1 parent 5ab0747 commit caed687
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/file-table-engine/src/table/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,8 @@ fn build_scan_plan<T: FileOpener + Send + 'static>(
projection: Option<&Vec<usize>>,
limit: Option<usize>,
) -> Result<PhysicalPlanRef> {
let stream = FileStream::new(
&FileScanConfig {
object_store_url: ObjectStoreUrl::parse("empty://").unwrap(), // won't be used
file_schema,
file_groups: vec![files
.iter()
.map(|filename| PartitionedFile::new(filename.to_string(), 0))
.collect::<Vec<_>>()],
statistics: Default::default(),
projection: projection.cloned(),
limit,
table_partition_cols: vec![],
output_ordering: None,
infinite_source: false,
},
0, // partition: hard-code
opener,
&ExecutionPlanMetricsSet::new(),
)
.context(error::BuildStreamSnafu)?;
let adapter = RecordBatchStreamAdapter::try_new(Box::pin(stream))
.context(error::BuildStreamAdapterSnafu)?;
Ok(Arc::new(StreamScanAdapter::new(Box::pin(adapter))))
let adapter = build_record_batch_stream(opener, file_schema, files, projection, limit)?;
Ok(Arc::new(StreamScanAdapter::new(adapter)))
}

fn build_record_batch_stream<T: FileOpener + Send + 'static>(
Expand Down

0 comments on commit caed687

Please sign in to comment.