Skip to content

Commit 03e860f

Browse files
PR comments
1 parent ba15301 commit 03e860f

9 files changed

Lines changed: 394 additions & 308 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/catalog-listing/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ datafusion-common = { workspace = true, features = ["object_store"] }
3838
datafusion-datasource = { workspace = true }
3939
datafusion-execution = { workspace = true }
4040
datafusion-expr = { workspace = true }
41-
datafusion-expr-common = { workspace = true }
4241
datafusion-physical-expr = { workspace = true }
4342
datafusion-physical-expr-adapter = { workspace = true }
4443
datafusion-physical-expr-common = { workspace = true }

datafusion/catalog-listing/src/options.rs

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,41 @@ pub struct ListingOptions {
5757
///
5858
/// Expressions are logical expressions over the full table schema. When set,
5959
/// [`ListingTable`](crate::ListingTable) creates one file group per
60-
/// declared output partition, preserving empty groups. When unset, file
61-
/// grouping uses the scan-time
60+
/// declared output partition. When unset, file grouping uses the scan-time
6261
/// [`SessionConfig::target_partitions`](datafusion_execution::config::SessionConfig::target_partitions).
63-
/// Declarations are limited to partitioning that can be represented by
64-
/// assigning whole files to file groups.
6562
///
66-
/// Files are assigned to groups in path order. DataFusion does not validate
67-
/// row placement, and callers must ensure file group `i` contains rows for
68-
/// partition `i`.
63+
/// Files are listed in path order, split into whole-file groups across the
64+
/// declared partition count, and then padded with trailing empty groups when
65+
/// needed. DataFusion does not route files by partition values or validate
66+
/// row placement, so callers must ensure file group `i` contains rows for
67+
/// partition `i`. Layouts that require explicit file-to-partition assignment
68+
/// are not supported.
69+
///
70+
/// For example, range partitioning on column `a` with split points
71+
/// `[10, 20, 30]` declares four output partitions. With three path-ordered
72+
/// files, the trailing partition is preserved as empty:
73+
///
74+
/// ```text
75+
/// files in path order: f0, f1, f2
76+
///
77+
/// file groups:
78+
/// partition 0: [f0]
79+
/// partition 1: [f1]
80+
/// partition 2: [f2]
81+
/// partition 3: []
82+
/// ```
83+
///
84+
/// With five path-ordered files, a partition can contain multiple files:
85+
///
86+
/// ```text
87+
/// files in path order: f0, f1, f2, f3, f4
88+
///
89+
/// file groups:
90+
/// partition 0: [f0, f1]
91+
/// partition 1: [f2, f3]
92+
/// partition 2: [f4]
93+
/// partition 3: []
94+
/// ```
6995
pub output_partitioning: Option<Partitioning>,
7096
}
7197

0 commit comments

Comments
 (0)