struct Parser<'a> {
val: &'a str,
tokenizer: Tokenizer<'a>,
}
Expand description
Implementation of parse_data_type
, modeled after https://github.com/sqlparser-rs/sqlparser-rs
Fields§
§val: &'a str
§tokenizer: Tokenizer<'a>
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
fn new(val: &'a str) -> Self
fn parse(self) -> Result<DataType, ArrowError>
Sourcefn parse_next_type(&mut self) -> Result<DataType, ArrowError>
fn parse_next_type(&mut self) -> Result<DataType, ArrowError>
parses the next full DataType
Sourcefn parse_list(&mut self) -> Result<DataType, ArrowError>
fn parse_list(&mut self) -> Result<DataType, ArrowError>
Parses the List type
Sourcefn parse_large_list(&mut self) -> Result<DataType, ArrowError>
fn parse_large_list(&mut self) -> Result<DataType, ArrowError>
Parses the LargeList type
Sourcefn parse_fixed_size_list(&mut self) -> Result<DataType, ArrowError>
fn parse_fixed_size_list(&mut self) -> Result<DataType, ArrowError>
Parses the FixedSizeList type
Sourcefn parse_time_unit(&mut self, context: &str) -> Result<TimeUnit, ArrowError>
fn parse_time_unit(&mut self, context: &str) -> Result<TimeUnit, ArrowError>
Parses the next timeunit
Sourcefn parse_timezone(
&mut self,
context: &str,
) -> Result<Option<String>, ArrowError>
fn parse_timezone( &mut self, context: &str, ) -> Result<Option<String>, ArrowError>
Parses the next timezone
Sourcefn parse_double_quoted_string(
&mut self,
context: &str,
) -> Result<String, ArrowError>
fn parse_double_quoted_string( &mut self, context: &str, ) -> Result<String, ArrowError>
Parses the next double quoted string
Sourcefn parse_i64(&mut self, context: &str) -> Result<i64, ArrowError>
fn parse_i64(&mut self, context: &str) -> Result<i64, ArrowError>
Parses the next integer value
Sourcefn parse_i32(&mut self, context: &str) -> Result<i32, ArrowError>
fn parse_i32(&mut self, context: &str) -> Result<i32, ArrowError>
Parses the next i32 integer value
Sourcefn parse_i8(&mut self, context: &str) -> Result<i8, ArrowError>
fn parse_i8(&mut self, context: &str) -> Result<i8, ArrowError>
Parses the next i8 integer value
Sourcefn parse_u8(&mut self, context: &str) -> Result<u8, ArrowError>
fn parse_u8(&mut self, context: &str) -> Result<u8, ArrowError>
Parses the next u8 integer value
Sourcefn parse_timestamp(&mut self) -> Result<DataType, ArrowError>
fn parse_timestamp(&mut self) -> Result<DataType, ArrowError>
Parses the next timestamp (called after Timestamp
has been consumed)
Sourcefn parse_time32(&mut self) -> Result<DataType, ArrowError>
fn parse_time32(&mut self) -> Result<DataType, ArrowError>
Parses the next Time32 (called after Time32
has been consumed)
Sourcefn parse_time64(&mut self) -> Result<DataType, ArrowError>
fn parse_time64(&mut self) -> Result<DataType, ArrowError>
Parses the next Time64 (called after Time64
has been consumed)
Sourcefn parse_duration(&mut self) -> Result<DataType, ArrowError>
fn parse_duration(&mut self) -> Result<DataType, ArrowError>
Parses the next Duration (called after Duration
has been consumed)
Sourcefn parse_interval(&mut self) -> Result<DataType, ArrowError>
fn parse_interval(&mut self) -> Result<DataType, ArrowError>
Parses the next Interval (called after Interval
has been consumed)
Sourcefn parse_fixed_size_binary(&mut self) -> Result<DataType, ArrowError>
fn parse_fixed_size_binary(&mut self) -> Result<DataType, ArrowError>
Parses the next FixedSizeBinary (called after FixedSizeBinary
has been consumed)
Sourcefn parse_decimal_128(&mut self) -> Result<DataType, ArrowError>
fn parse_decimal_128(&mut self) -> Result<DataType, ArrowError>
Parses the next Decimal128 (called after Decimal128
has been consumed)
Sourcefn parse_decimal_256(&mut self) -> Result<DataType, ArrowError>
fn parse_decimal_256(&mut self) -> Result<DataType, ArrowError>
Parses the next Decimal256 (called after Decimal256
has been consumed)
Sourcefn parse_dictionary(&mut self) -> Result<DataType, ArrowError>
fn parse_dictionary(&mut self) -> Result<DataType, ArrowError>
Parses the next Dictionary (called after Dictionary
has been consumed)
Sourcefn next_token(&mut self) -> Result<Token, ArrowError>
fn next_token(&mut self) -> Result<Token, ArrowError>
return the next token, or an error if there are none left
Sourcefn expect_token(&mut self, tok: Token) -> Result<(), ArrowError>
fn expect_token(&mut self, tok: Token) -> Result<(), ArrowError>
consume the next token, returning OK(()) if it matches tok, and Err if not