Struct datafusion::execution::options::NdJsonReadOptions
source · pub struct NdJsonReadOptions<'a> {
pub schema: Option<SchemaRef>,
pub schema_infer_max_records: usize,
pub file_extension: &'a str,
pub table_partition_cols: Vec<(String, DataType)>,
pub file_compression_type: FileCompressionType,
}
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<SchemaRef>
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
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 file_compression_type(
self,
file_compression_type: FileCompressionType
) -> Self
pub fn file_compression_type(
self,
file_compression_type: FileCompressionType
) -> Self
Specify file_compression_type
sourcepub fn to_listing_options(&self, target_partitions: usize) -> ListingOptions
pub fn to_listing_options(&self, target_partitions: usize) -> ListingOptions
Helper to convert these user facing options to ListingTable
options
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>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more