Struct deltalake::datafusion::prelude::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,
pub file_sort_order: Vec<Vec<Expr>>,
}
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).
file_sort_order: Vec<Vec<Expr>>
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)>
) -> NdJsonReadOptions<'a>
pub fn table_partition_cols( self, table_partition_cols: Vec<(String, DataType)> ) -> NdJsonReadOptions<'a>
Specify table_partition_cols for partition pruning
sourcepub fn file_extension(self, file_extension: &'a str) -> NdJsonReadOptions<'a>
pub fn file_extension(self, file_extension: &'a str) -> NdJsonReadOptions<'a>
Specify file_extension
sourcepub fn mark_infinite(self, infinite: bool) -> NdJsonReadOptions<'a>
pub fn mark_infinite(self, infinite: bool) -> NdJsonReadOptions<'a>
Configure mark_infinite setting
sourcepub fn file_compression_type(
self,
file_compression_type: FileCompressionType
) -> NdJsonReadOptions<'a>
pub fn file_compression_type( self, file_compression_type: FileCompressionType ) -> NdJsonReadOptions<'a>
Specify file_compression_type
sourcepub fn schema(self, schema: &'a Schema) -> NdJsonReadOptions<'a>
pub fn schema(self, schema: &'a Schema) -> NdJsonReadOptions<'a>
Specify schema to use for NdJson read
sourcepub fn file_sort_order(
self,
file_sort_order: Vec<Vec<Expr>>
) -> NdJsonReadOptions<'a>
pub fn file_sort_order( self, file_sort_order: Vec<Vec<Expr>> ) -> NdJsonReadOptions<'a>
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<'a> Default for NdJsonReadOptions<'a>
impl<'a> Default for NdJsonReadOptions<'a>
source§fn default() -> NdJsonReadOptions<'a>
fn default() -> NdJsonReadOptions<'a>
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<Arc<Schema>, DataFusionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
NdJsonReadOptions<'_>: '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<Arc<Schema>, DataFusionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
NdJsonReadOptions<'_>: '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<Arc<Schema>, DataFusionError>> + Send + 'async_trait>>where
'a: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + '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<Arc<Schema>, DataFusionError>> + Send + 'async_trait>>where
'a: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + '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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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