pub struct ParserOptions {
pub parse_float_as_decimal: bool,
pub enable_ident_normalization: bool,
pub support_varchar_with_length: bool,
pub enable_options_value_normalization: bool,
pub collect_spans: bool,
pub map_varchar_to_utf8view: bool,
}
Expand description
SQL parser options
Fields§
§parse_float_as_decimal: bool
Whether to parse float as decimal.
enable_ident_normalization: bool
Whether to normalize identifiers.
support_varchar_with_length: bool
Whether to support varchar with length.
enable_options_value_normalization: bool
Whether to normalize options value.
collect_spans: bool
Whether to collect spans
map_varchar_to_utf8view: bool
Whether VARCHAR
is mapped to Utf8View
during SQL planning.
Implementations§
Source§impl ParserOptions
impl ParserOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ParserOptions
instance with default values.
§Examples
use datafusion_sql::planner::ParserOptions;
let opts = ParserOptions::new();
assert_eq!(opts.parse_float_as_decimal, false);
assert_eq!(opts.enable_ident_normalization, true);
Sourcepub fn with_parse_float_as_decimal(self, value: bool) -> Self
pub fn with_parse_float_as_decimal(self, value: bool) -> Self
Sets the parse_float_as_decimal
option.
§Examples
use datafusion_sql::planner::ParserOptions;
let opts = ParserOptions::new().with_parse_float_as_decimal(true);
assert_eq!(opts.parse_float_as_decimal, true);
Sourcepub fn with_enable_ident_normalization(self, value: bool) -> Self
pub fn with_enable_ident_normalization(self, value: bool) -> Self
Sets the enable_ident_normalization
option.
§Examples
use datafusion_sql::planner::ParserOptions;
let opts = ParserOptions::new().with_enable_ident_normalization(false);
assert_eq!(opts.enable_ident_normalization, false);
Sourcepub fn with_support_varchar_with_length(self, value: bool) -> Self
pub fn with_support_varchar_with_length(self, value: bool) -> Self
Sets the support_varchar_with_length
option.
Sourcepub fn with_map_varchar_to_utf8view(self, value: bool) -> Self
pub fn with_map_varchar_to_utf8view(self, value: bool) -> Self
Sets the map_varchar_to_utf8view
option.
Sourcepub fn with_enable_options_value_normalization(self, value: bool) -> Self
pub fn with_enable_options_value_normalization(self, value: bool) -> Self
Sets the enable_options_value_normalization
option.
Sourcepub fn with_collect_spans(self, value: bool) -> Self
pub fn with_collect_spans(self, value: bool) -> Self
Sets the collect_spans
option.
Trait Implementations§
Source§impl Clone for ParserOptions
impl Clone for ParserOptions
Source§fn clone(&self) -> ParserOptions
fn clone(&self) -> ParserOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParserOptions
impl Debug for ParserOptions
Source§impl Default for ParserOptions
impl Default for ParserOptions
Source§impl From<&SqlParserOptions> for ParserOptions
impl From<&SqlParserOptions> for ParserOptions
Source§fn from(options: &SqlParserOptions) -> Self
fn from(options: &SqlParserOptions) -> Self
Converts to this type from the input type.
impl Copy for ParserOptions
Auto Trait Implementations§
impl Freeze for ParserOptions
impl RefUnwindSafe for ParserOptions
impl Send for ParserOptions
impl Sync for ParserOptions
impl Unpin for ParserOptions
impl UnwindSafe for ParserOptions
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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