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() -> Self
pub fn new() -> Self
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) -> Self
pub fn default_from_session_config(config: &ConfigOptions) -> Self
sourcepub fn combine_with_session_config(&self, config: &ConfigOptions) -> Self
pub fn combine_with_session_config(&self, config: &ConfigOptions) -> Self
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) -> Self
pub fn with_extensions(self, extensions: Extensions) -> Self
sourcepub fn alter_with_string_hash_map(
&mut self,
settings: &HashMap<String, String>,
) -> Result<()>
pub fn alter_with_string_hash_map( &mut self, settings: &HashMap<String, String>, ) -> Result<()>
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: Visit>(
&self,
v: &mut V,
_key_prefix: &str,
_description: &'static str,
)
fn visit<V: Visit>( &self, v: &mut V, _key_prefix: &str, _description: &'static str, )
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<()>
fn set(&mut self, key: &str, value: &str) -> Result<()>
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
)