mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-14 07:52:02 +00:00
Support for DuckDB Union datatype (#1322)
This commit is contained in:
parent
f5ccef6ea9
commit
f9ab8dcc27
4 changed files with 151 additions and 1 deletions
|
@ -294,6 +294,23 @@ impl fmt::Display for StructField {
|
|||
}
|
||||
}
|
||||
|
||||
/// A field definition within a union
|
||||
///
|
||||
/// [duckdb]: https://duckdb.org/docs/sql/data_types/union.html
|
||||
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
|
||||
pub struct UnionField {
|
||||
pub field_name: Ident,
|
||||
pub field_type: DataType,
|
||||
}
|
||||
|
||||
impl fmt::Display for UnionField {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{} {}", self.field_name, self.field_type)
|
||||
}
|
||||
}
|
||||
|
||||
/// A dictionary field within a dictionary.
|
||||
///
|
||||
/// [duckdb]: https://duckdb.org/docs/sql/data_types/struct#creating-structs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue