Struct datafusion_common::file_options::StatementOptions
source · pub struct StatementOptions { /* private fields */ }
Expand description
Represents arbitrary tuples of options passed as String tuples from SQL statements. As in the following statement: COPY … TO … (setting1 value1, setting2 value2, …)
Implementations§
source§impl StatementOptions
impl StatementOptions
pub fn new(options: Vec<OptionTuple>) -> Self
pub fn into_inner(self) -> Vec<OptionTuple>
sourcepub fn take_bool_option(&mut self, find: &str) -> Result<Option<bool>>
pub fn take_bool_option(&mut self, find: &str) -> Result<Option<bool>>
Scans for option and if it exists removes it and attempts to parse as a boolean Returns none if it does not exist.
sourcepub fn take_str_option(&mut self, find: &str) -> Option<String>
pub fn take_str_option(&mut self, find: &str) -> Option<String>
Scans for option and if it exists removes it and returns it Returns none if it does not exist
sourcepub fn try_infer_file_type(&mut self, target: &str) -> Result<FileType>
pub fn try_infer_file_type(&mut self, target: &str) -> Result<FileType>
Infers the file_type given a target and arbitrary options. If the options contain an explicit “format” option, that will be used. Otherwise, attempt to infer file_type from the extension of target. Finally, return an error if unable to determine the file_type If found, format is removed from the options list.
Trait Implementations§
source§impl Clone for StatementOptions
impl Clone for StatementOptions
source§fn clone(&self) -> StatementOptions
fn clone(&self) -> StatementOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StatementOptions
impl Debug for StatementOptions
source§impl From<&HashMap<String, String, RandomState>> for StatementOptions
impl From<&HashMap<String, String, RandomState>> for StatementOptions
Useful for conversion from external tables which use Hashmap<String, String>
source§impl Hash for StatementOptions
impl Hash for StatementOptions
source§impl PartialEq<StatementOptions> for StatementOptions
impl PartialEq<StatementOptions> for StatementOptions
source§fn eq(&self, other: &StatementOptions) -> bool
fn eq(&self, other: &StatementOptions) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for StatementOptions
impl StructuralEq for StatementOptions
impl StructuralPartialEq for StatementOptions
Auto Trait Implementations§
impl RefUnwindSafe for StatementOptions
impl Send for StatementOptions
impl Sync for StatementOptions
impl Unpin for StatementOptions
impl UnwindSafe for StatementOptions
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.