Struct datafusion::common::config::TableOptions
source · pub struct TableOptions {
pub csv: CsvOptions,
pub parquet: TableParquetOptions,
pub json: JsonOptions,
pub current_format: Option<ConfigFileType>,
pub extensions: Extensions,
}
Expand description
Represents the configuration options available for handling different table formats within a data processing application. This struct encompasses options for various file formats including CSV, Parquet, and JSON, allowing for flexible configuration of parsing and writing behaviors specific to each format. Additionally, it supports extending functionality through custom extensions.
Fields§
§csv: CsvOptions
Configuration options for CSV file handling. This includes settings like the delimiter, quote character, and whether the first row is considered as headers.
parquet: TableParquetOptions
Configuration options for Parquet file handling. This includes settings for compression, encoding, and other Parquet-specific file characteristics.
json: JsonOptions
Configuration options for JSON file handling.
current_format: Option<ConfigFileType>
The current file format that the table operations should assume. This option allows for dynamic switching between the supported file types (e.g., CSV, Parquet, JSON).
extensions: Extensions
Optional extensions that can be used to extend or customize the behavior of the table
options. Extensions can be registered using Extensions::insert
and might include
custom file handling logic, additional configuration parameters, or other enhancements.
Implementations§
source§impl TableOptions
impl TableOptions
sourcepub fn new() -> TableOptions
pub fn new() -> TableOptions
Constructs a new instance of TableOptions
with default settings.
§Returns
A new TableOptions
instance with default configuration values.
sourcepub fn default_from_session_config(config: &ConfigOptions) -> TableOptions
pub fn default_from_session_config(config: &ConfigOptions) -> TableOptions
sourcepub fn combine_with_session_config(
&self,
config: &ConfigOptions,
) -> TableOptions
pub fn combine_with_session_config( &self, config: &ConfigOptions, ) -> TableOptions
sourcepub fn set_config_format(&mut self, format: ConfigFileType)
pub fn set_config_format(&mut self, format: ConfigFileType)
Sets the file format for the table.
§Parameters
format
: The file format to use (e.g., CSV, Parquet).
sourcepub fn with_extensions(self, extensions: Extensions) -> TableOptions
pub fn with_extensions(self, extensions: Extensions) -> TableOptions
sourcepub fn from_string_hash_map(
settings: &HashMap<String, String>,
) -> Result<TableOptions, DataFusionError>
pub fn from_string_hash_map( settings: &HashMap<String, String>, ) -> Result<TableOptions, DataFusionError>
sourcepub fn alter_with_string_hash_map(
&mut self,
settings: &HashMap<String, String>,
) -> Result<(), DataFusionError>
pub fn alter_with_string_hash_map( &mut self, settings: &HashMap<String, String>, ) -> Result<(), DataFusionError>
sourcepub fn entries(&self) -> Vec<ConfigEntry>
pub fn entries(&self) -> Vec<ConfigEntry>
Retrieves all configuration entries from this TableOptions
.
§Returns
A vector of ConfigEntry
instances, representing all the configuration options within this TableOptions
.
Trait Implementations§
source§impl Clone for TableOptions
impl Clone for TableOptions
source§fn clone(&self) -> TableOptions
fn clone(&self) -> TableOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConfigField for TableOptions
impl ConfigField for TableOptions
source§fn visit<V>(&self, v: &mut V, _key_prefix: &str, _description: &'static str)where
V: Visit,
fn visit<V>(&self, v: &mut V, _key_prefix: &str, _description: &'static str)where
V: Visit,
Visits configuration settings for the current file format, or all formats if none is selected.
This method adapts the behavior based on whether a file format is currently selected in current_format
.
If a format is selected, it visits only the settings relevant to that format. Otherwise,
it visits all available format settings.
source§fn set(&mut self, key: &str, value: &str) -> Result<(), DataFusionError>
fn set(&mut self, key: &str, value: &str) -> Result<(), DataFusionError>
Sets a configuration value for a specific key within TableOptions
.
This method delegates setting configuration values to the specific file format configurations, based on the current format selected. If no format is selected, it returns an error.
§Parameters
key
: The configuration key specifying which setting to adjust, prefixed with the format (e.g., “format.delimiter”) for CSV format.value
: The value to set for the specified configuration key.
§Returns
A result indicating success or an error if the key is not recognized, if a format is not specified, or if setting the configuration value fails for the specific format.
source§impl Debug for TableOptions
impl Debug for TableOptions
source§impl Default for TableOptions
impl Default for TableOptions
source§fn default() -> TableOptions
fn default() -> TableOptions
Auto Trait Implementations§
impl Freeze for TableOptions
impl !RefUnwindSafe for TableOptions
impl Send for TableOptions
impl Sync for TableOptions
impl Unpin for TableOptions
impl !UnwindSafe for TableOptions
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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