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,
pub file_sort_order: Vec<Vec<SortExpr>>,
}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: usizeMax number of rows to read from JSON files for schema inference if needed. Defaults to DEFAULT_SCHEMA_INFER_MAX_RECORD.
file_extension: &'a strFile 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: FileCompressionTypeFile compression type
infinite: boolFlag indicating whether this file may be unbounded (as in a FIFO file).
file_sort_order: Vec<Vec<SortExpr>>Indicates how the file is sorted
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
Sourcepub fn file_sort_order(self, file_sort_order: Vec<Vec<SortExpr>>) -> Self
pub fn file_sort_order(self, file_sort_order: Vec<Vec<SortExpr>>) -> Self
Configure if file has known sort order
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 Default for NdJsonReadOptions<'_>
impl Default for NdJsonReadOptions<'_>
Source§impl ReadOptions<'_> for NdJsonReadOptions<'_>
impl ReadOptions<'_> for NdJsonReadOptions<'_>
Source§fn to_listing_options(
&self,
config: &SessionConfig,
table_options: TableOptions,
) -> ListingOptions
fn to_listing_options( &self, config: &SessionConfig, table_options: TableOptions, ) -> ListingOptions
ListingTable optionsSource§fn get_resolved_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_resolved_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn _get_resolved_schema<'life0, 'async_trait>(
&'a self,
config: &'life0 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
schema: Option<&'a Schema>,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn _get_resolved_schema<'life0, 'async_trait>(
&'a self,
config: &'life0 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
schema: Option<&'a Schema>,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<'a> Freeze for NdJsonReadOptions<'a>
impl<'a> !RefUnwindSafe for NdJsonReadOptions<'a>
impl<'a> Send for NdJsonReadOptions<'a>
impl<'a> Sync for NdJsonReadOptions<'a>
impl<'a> Unpin for NdJsonReadOptions<'a>
impl<'a> !UnwindSafe for NdJsonReadOptions<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more