1515// specific language governing permissions and limitations
1616// under the License.
1717
18+ //! [`DataSource`] and [`DataSourceExec`]
19+
1820use std:: any:: Any ;
1921use std:: fmt;
2022use std:: fmt:: { Debug , Formatter } ;
@@ -34,9 +36,15 @@ use datafusion_physical_expr::{EquivalenceProperties, Partitioning};
3436use datafusion_physical_expr_common:: sort_expr:: LexOrdering ;
3537
3638/// Common behaviors in Data Sources for both from Files and Memory.
37- /// See `DataSourceExec` for physical plan implementation
3839///
40+ /// # See Also
41+ /// * [`DataSourceExec`] for physical plan implementation
42+ /// * [`FileSource`] for file format implementations (Parquet, Json, etc)
43+ ///
44+ /// # Notes
3945/// Requires `Debug` to assist debugging
46+ ///
47+ /// [`FileSource`]: crate::file::FileSource
4048pub trait DataSource : Send + Sync + Debug {
4149 fn open (
4250 & self ,
@@ -71,10 +79,21 @@ pub trait DataSource: Send + Sync + Debug {
7179 ) -> datafusion_common:: Result < Option < Arc < dyn ExecutionPlan > > > ;
7280}
7381
74- /// Unified data source for file formats like JSON, CSV, AVRO, ARROW, PARQUET
82+ /// [`ExecutionPlan`] handles different file formats like JSON, CSV, AVRO, ARROW, PARQUET
83+ ///
84+ /// `DataSourceExec` implements common functionality such as applying projections,
85+ /// and caching plan properties.
86+ ///
87+ /// The [`DataSource`] trait describes where to find the data for this data
88+ /// source (for example what files or what in memory partitions). Format
89+ /// specifics are implemented with the [`FileSource`] trait.
90+ ///
91+ /// [`FileSource`]: crate::file::FileSource
7592#[ derive( Clone , Debug ) ]
7693pub struct DataSourceExec {
94+ /// The source of the data -- for example, `FileScanConfig` or `MemorySourceConfig`
7795 data_source : Arc < dyn DataSource > ,
96+ /// Cached plan properties such as sort order
7897 cache : PlanProperties ,
7998}
8099
0 commit comments