Skip to content

Commit a1c9663

Browse files
authored
Add more stream docs (#8192)
1 parent cd1c648 commit a1c9663

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

datafusion/core/src/datasource/stream.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ pub struct StreamConfig {
104104

105105
impl StreamConfig {
106106
/// Stream data from the file at `location`
107+
///
108+
/// * Data will be read sequentially from the provided `location`
109+
/// * New data will be appended to the end of the file
110+
///
111+
/// The encoding can be configured with [`Self::with_encoding`] and
112+
/// defaults to [`StreamEncoding::Csv`]
107113
pub fn new_file(schema: SchemaRef, location: PathBuf) -> Self {
108114
Self {
109115
schema,
@@ -180,11 +186,20 @@ impl StreamConfig {
180186
}
181187
}
182188

183-
/// A [`TableProvider`] for a stream source, such as a FIFO file
189+
/// A [`TableProvider`] for an unbounded stream source
190+
///
191+
/// Currently only reading from / appending to a single file in-place is supported, but
192+
/// other stream sources and sinks may be added in future.
193+
///
194+
/// Applications looking to read/write datasets comprising multiple files, e.g. [Hadoop]-style
195+
/// data stored in object storage, should instead consider [`ListingTable`].
196+
///
197+
/// [Hadoop]: https://hadoop.apache.org/
198+
/// [`ListingTable`]: crate::datasource::listing::ListingTable
184199
pub struct StreamTable(Arc<StreamConfig>);
185200

186201
impl StreamTable {
187-
/// Create a new [`StreamTable`] for the given `StreamConfig`
202+
/// Create a new [`StreamTable`] for the given [`StreamConfig`]
188203
pub fn new(config: Arc<StreamConfig>) -> Self {
189204
Self(config)
190205
}

0 commit comments

Comments
 (0)