@@ -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