Skip to content

Commit 5e1cef9

Browse files
author
Devdutt Shenoi
committed
fix: non-unix compilation
1 parent a0d2c8e commit 5e1cef9

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

src/query/stream_schema_provider.rs

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
*
1717
*/
1818

19-
use std::any::Any;
20-
use std::collections::HashMap;
21-
use std::ops::Bound;
22-
use std::os::unix::fs::MetadataExt;
23-
use std::sync::Arc;
19+
use std::{any::Any, collections::HashMap, ops::Bound, sync::Arc};
2420

2521
use arrow_array::RecordBatch;
2622
use arrow_schema::{Schema, SchemaRef, SortOptions};
@@ -44,8 +40,8 @@ use datafusion::{
4440
logical_expr::{
4541
utils::conjunction, BinaryExpr, Operator, TableProviderFilterPushDown, TableType,
4642
},
47-
physical_expr::{create_physical_expr, LexOrdering, PhysicalSortExpr},
48-
physical_plan::{self, empty::EmptyExec, union::UnionExec, ExecutionPlan, Statistics},
43+
physical_expr::{create_physical_expr, expressions::col, LexOrdering, PhysicalSortExpr},
44+
physical_plan::{empty::EmptyExec, union::UnionExec, ExecutionPlan, Statistics},
4945
prelude::Expr,
5046
scalar::ScalarValue,
5147
};
@@ -57,20 +53,20 @@ use url::Url;
5753

5854
use crate::{
5955
catalog::{
60-
self, column::TypedStatistics, manifest::File, manifest::Manifest, snapshot::ManifestItem,
61-
snapshot::Snapshot, ManifestFile,
56+
column::{Column, TypedStatistics},
57+
manifest::{File, Manifest},
58+
snapshot::{ManifestItem, Snapshot},
59+
ManifestFile, Snapshot as CatalogSnapshot,
6260
},
6361
event::DEFAULT_TIMESTAMP_KEY,
6462
hottier::HotTierManager,
6563
metrics::QUERY_CACHE_HIT,
6664
option::Mode,
67-
parseable::PARSEABLE,
68-
parseable::STREAM_EXISTS,
65+
parseable::{PARSEABLE, STREAM_EXISTS},
6966
storage::{ObjectStorage, ObjectStoreFormat, STREAM_ROOT_DIRECTORY},
7067
};
7168

7269
use super::listing_table_builder::ListingTableBuilder;
73-
use crate::catalog::Snapshot as CatalogSnapshot;
7470

7571
// schema provider for stream based on global data
7672
#[derive(Debug)]
@@ -141,9 +137,9 @@ impl StandardTableProvider {
141137

142138
let sort_expr = PhysicalSortExpr {
143139
expr: if let Some(time_partition) = time_partition {
144-
physical_plan::expressions::col(&time_partition, &self.schema)?
140+
col(&time_partition, &self.schema)?
145141
} else {
146-
physical_plan::expressions::col(DEFAULT_TIMESTAMP_KEY, &self.schema)?
142+
col(DEFAULT_TIMESTAMP_KEY, &self.schema)?
147143
},
148144
options: SortOptions {
149145
descending: true,
@@ -249,7 +245,7 @@ impl StandardTableProvider {
249245
let Ok(file_meta) = file_path.metadata() else {
250246
continue;
251247
};
252-
let file = PartitionedFile::new(file_path.display().to_string(), file_meta.size());
248+
let file = PartitionedFile::new(file_path.display().to_string(), file_meta.len());
253249
partitioned_files[index % target_partition].push(file)
254250
}
255251

@@ -324,20 +320,19 @@ impl StandardTableProvider {
324320

325321
fn partitioned_files(
326322
&self,
327-
manifest_files: Vec<catalog::manifest::File>,
323+
manifest_files: Vec<File>,
328324
) -> (Vec<Vec<PartitionedFile>>, datafusion::common::Statistics) {
329325
let target_partition = num_cpus::get();
330326
let mut partitioned_files = Vec::from_iter((0..target_partition).map(|_| Vec::new()));
331-
let mut column_statistics =
332-
HashMap::<String, Option<catalog::column::TypedStatistics>>::new();
327+
let mut column_statistics = HashMap::<String, Option<TypedStatistics>>::new();
333328
let mut count = 0;
334329
for (index, file) in manifest_files
335330
.into_iter()
336331
.enumerate()
337332
.map(|(x, y)| (x % target_partition, y))
338333
{
339334
#[allow(unused_mut)]
340-
let catalog::manifest::File {
335+
let File {
341336
mut file_path,
342337
num_rows,
343338
columns,
@@ -404,12 +399,12 @@ impl StandardTableProvider {
404399
}
405400

406401
async fn collect_from_snapshot(
407-
snapshot: &catalog::snapshot::Snapshot,
402+
snapshot: &Snapshot,
408403
time_filters: &[PartialTimeFilter],
409404
object_store: Arc<dyn ObjectStore>,
410405
filters: &[Expr],
411406
limit: Option<usize>,
412-
) -> Result<Vec<catalog::manifest::File>, DataFusionError> {
407+
) -> Result<Vec<File>, DataFusionError> {
413408
let items = snapshot.manifests(time_filters);
414409
let manifest_files = collect_manifest_files(
415410
object_store,
@@ -895,7 +890,7 @@ pub fn extract_primary_filter(
895890
}
896891

897892
trait ManifestExt: ManifestFile {
898-
fn find_matching_column(&self, partial_filter: &Expr) -> Option<&catalog::column::Column> {
893+
fn find_matching_column(&self, partial_filter: &Expr) -> Option<&Column> {
899894
let name = match partial_filter {
900895
Expr::BinaryExpr(binary_expr) => {
901896
let Expr::Column(col) = binary_expr.left.as_ref() else {

0 commit comments

Comments
 (0)