MCPcopy Create free account
hub / github.com/apache/datafusion / scan_empty_with_partitions

Function scan_empty_with_partitions

datafusion/core/src/test_util/mod.rs:78–88  ·  view source on GitHub ↗

Scan an empty data source with configured partition, mainly used in tests.

(
    name: Option<&str>,
    table_schema: &Schema,
    projection: Option<Vec<usize>>,
    partitions: usize,
)

Source from the content-addressed store, hash-verified

76
77/// Scan an empty data source with configured partition, mainly used in tests.
78pub fn scan_empty_with_partitions(
79 name: Option<&str>,
80 table_schema: &Schema,
81 projection: Option<Vec<usize>>,
82 partitions: usize,
83) -> Result<LogicalPlanBuilder> {
84 let table_schema = Arc::new(table_schema.clone());
85 let provider = Arc::new(EmptyTable::new(table_schema).with_partitions(partitions));
86 let name = TableReference::bare(name.unwrap_or(UNNAMED_TABLE));
87 LogicalPlanBuilder::scan(name, provider_as_source(provider), projection)
88}
89
90/// Get the schema for the aggregate_test_* csv files
91pub fn aggr_test_schema() -> SchemaRef {

Callers 1

Calls 5

newFunction · 0.85
provider_as_sourceFunction · 0.85
scanFunction · 0.50
cloneMethod · 0.45
with_partitionsMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…