-
Notifications
You must be signed in to change notification settings - Fork 763
/
Copy pathplan_read_datasource.rs
50 lines (43 loc) · 1.27 KB
/
plan_read_datasource.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2020-2021 The Datafuse Authors.
//
// SPDX-License-Identifier: Apache-2.0.
use std::sync::Arc;
use common_datavalues::DataSchema;
use common_datavalues::DataSchemaRef;
use crate::Extras;
use crate::Partitions;
use crate::ScanPlan;
use crate::Statistics;
// TODO: Delete the scan plan field, but it depends on plan_parser:L394
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)]
pub struct ReadDataSourcePlan {
pub db: String,
pub table: String,
pub schema: DataSchemaRef,
pub parts: Partitions,
pub statistics: Statistics,
pub description: String,
pub scan_plan: Arc<ScanPlan>,
pub remote: bool,
}
impl ReadDataSourcePlan {
pub fn empty() -> ReadDataSourcePlan {
ReadDataSourcePlan {
db: "".to_string(),
table: "".to_string(),
schema: Arc::from(DataSchema::empty()),
parts: vec![],
statistics: Statistics::default(),
description: "".to_string(),
scan_plan: Arc::new(ScanPlan::empty()),
remote: false,
}
}
pub fn schema(&self) -> DataSchemaRef {
self.schema.clone()
}
/// Get the push downs.
pub fn get_push_downs(&self) -> Extras {
self.scan_plan.push_downs.clone()
}
}