mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-02 13:12:16 +00:00
Implement Hive QL Parsing (#235)
This commit is contained in:
parent
17f8eb9c5a
commit
8a214f9919
16 changed files with 1388 additions and 176 deletions
|
@ -22,15 +22,17 @@ use std::fmt;
|
|||
pub enum Value {
|
||||
/// Numeric literal
|
||||
#[cfg(not(feature = "bigdecimal"))]
|
||||
Number(String),
|
||||
Number(String, bool),
|
||||
#[cfg(feature = "bigdecimal")]
|
||||
Number(BigDecimal),
|
||||
Number(BigDecimal, bool),
|
||||
/// 'string value'
|
||||
SingleQuotedString(String),
|
||||
/// N'string value'
|
||||
NationalStringLiteral(String),
|
||||
/// X'hex value'
|
||||
HexStringLiteral(String),
|
||||
|
||||
DoubleQuotedString(String),
|
||||
/// Boolean value true or false
|
||||
Boolean(bool),
|
||||
/// INTERVAL literals, roughly in the following format:
|
||||
|
@ -59,7 +61,8 @@ pub enum Value {
|
|||
impl fmt::Display for Value {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
Value::Number(v) => write!(f, "{}", v),
|
||||
Value::Number(v, l) => write!(f, "{}{long}", v, long = if *l { "L" } else { "" }),
|
||||
Value::DoubleQuotedString(v) => write!(f, "\"{}\"", v),
|
||||
Value::SingleQuotedString(v) => write!(f, "'{}'", escape_single_quote_string(v)),
|
||||
Value::NationalStringLiteral(v) => write!(f, "N'{}'", v),
|
||||
Value::HexStringLiteral(v) => write!(f, "X'{}'", v),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue