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

Method test_config

datafusion/datasource/src/file_stream/mod.rs:1565–1591  ·  view source on GitHub ↗

Builds a `FileScanConfig` covering every configured partition.

(&self)

Source from the content-addressed store, hash-verified

1563
1564 /// Builds a `FileScanConfig` covering every configured partition.
1565 fn test_config(&self) -> FileScanConfig {
1566 let file_groups = (0..self.num_partitions())
1567 .map(|partition| {
1568 self.partition_files
1569 .get(&PartitionId(partition))
1570 .into_iter()
1571 .flat_map(|files| files.iter())
1572 .map(|name| PartitionedFile::new(name, 10))
1573 .collect::<Vec<_>>()
1574 .into()
1575 })
1576 .collect::<Vec<_>>();
1577
1578 let table_schema = TableSchema::new(
1579 Arc::new(Schema::new(vec![Field::new("i", DataType::Int32, false)])),
1580 vec![],
1581 );
1582 FileScanConfigBuilder::new(
1583 ObjectStoreUrl::parse("test:///").unwrap(),
1584 Arc::new(MockSource::new(table_schema)),
1585 )
1586 .with_file_groups(file_groups)
1587 .with_limit(self.limit)
1588 .with_preserve_order(self.preserve_order)
1589 .with_partitioned_by_file_group(self.partitioned_by_file_group)
1590 .build()
1591 }
1592 }
1593
1594 /// Formats one stream poll result into a stable snapshot line.

Calls 13

PartitionIdClass · 0.85
newFunction · 0.85
with_file_groupsMethod · 0.80
mapMethod · 0.45
num_partitionsMethod · 0.45
intoMethod · 0.45
into_iterMethod · 0.45
getMethod · 0.45
iterMethod · 0.45
buildMethod · 0.45
with_preserve_orderMethod · 0.45

Tested by

no test coverage detected