Struct datafusion::datasource::file_format::options::NdJsonReadOptions
source · pub struct NdJsonReadOptions<'a> {
pub schema: Option<&'a Schema>,
pub schema_infer_max_records: usize,
pub file_extension: &'a str,
pub table_partition_cols: Vec<(String, DataType)>,
pub file_compression_type: FileCompressionType,
pub infinite: bool,
}
Expand description
Options that control the reading of Line-delimited JSON files (NDJson)
Note this structure is supplied when a datasource is created and
can not not vary from statement to statement. For settings that
can vary statement to statement see
ConfigOptions
.
Fields§
§schema: Option<&'a Schema>
The data source schema.
schema_infer_max_records: usize
Max number of rows to read from JSON files for schema inference if needed. Defaults to DEFAULT_SCHEMA_INFER_MAX_RECORD
.
file_extension: &'a str
File extension; only files with this extension are selected for data input.
Defaults to FileType::JSON.get_ext().as_str()
.
table_partition_cols: Vec<(String, DataType)>
Partition Columns
file_compression_type: FileCompressionType
File compression type
infinite: bool
Flag indicating whether this file may be unbounded (as in a FIFO file).
Implementations§
source§impl<'a> NdJsonReadOptions<'a>
impl<'a> NdJsonReadOptions<'a>
sourcepub fn table_partition_cols(
self,
table_partition_cols: Vec<(String, DataType)>
) -> Self
pub fn table_partition_cols( self, table_partition_cols: Vec<(String, DataType)> ) -> Self
Specify table_partition_cols for partition pruning
sourcepub fn file_extension(self, file_extension: &'a str) -> Self
pub fn file_extension(self, file_extension: &'a str) -> Self
Specify file_extension
sourcepub fn mark_infinite(self, infinite: bool) -> Self
pub fn mark_infinite(self, infinite: bool) -> Self
Configure mark_infinite setting
sourcepub fn file_compression_type(
self,
file_compression_type: FileCompressionType
) -> Self
pub fn file_compression_type( self, file_compression_type: FileCompressionType ) -> Self
Specify file_compression_type
Trait Implementations§
source§impl<'a> Clone for NdJsonReadOptions<'a>
impl<'a> Clone for NdJsonReadOptions<'a>
source§fn clone(&self) -> NdJsonReadOptions<'a>
fn clone(&self) -> NdJsonReadOptions<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Default for NdJsonReadOptions<'a>
impl<'a> Default for NdJsonReadOptions<'a>
source§impl ReadOptions<'_> for NdJsonReadOptions<'_>
impl ReadOptions<'_> for NdJsonReadOptions<'_>
source§fn to_listing_options(&self, config: &SessionConfig) -> ListingOptions
fn to_listing_options(&self, config: &SessionConfig) -> ListingOptions
ListingTable
options