mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 21:42:05 +00:00
Add support for INCLUDE/EXCLUDE NULLS for UNPIVOT (#1849)
This commit is contained in:
parent
c6e897dc12
commit
3c59950060
5 changed files with 111 additions and 44 deletions
|
@ -13368,6 +13368,15 @@ impl<'a> Parser<'a> {
|
|||
&mut self,
|
||||
table: TableFactor,
|
||||
) -> Result<TableFactor, ParserError> {
|
||||
let null_inclusion = if self.parse_keyword(Keyword::INCLUDE) {
|
||||
self.expect_keyword_is(Keyword::NULLS)?;
|
||||
Some(NullInclusion::IncludeNulls)
|
||||
} else if self.parse_keyword(Keyword::EXCLUDE) {
|
||||
self.expect_keyword_is(Keyword::NULLS)?;
|
||||
Some(NullInclusion::ExcludeNulls)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
self.expect_token(&Token::LParen)?;
|
||||
let value = self.parse_identifier()?;
|
||||
self.expect_keyword_is(Keyword::FOR)?;
|
||||
|
@ -13379,6 +13388,7 @@ impl<'a> Parser<'a> {
|
|||
Ok(TableFactor::Unpivot {
|
||||
table: Box::new(table),
|
||||
value,
|
||||
null_inclusion,
|
||||
name,
|
||||
columns,
|
||||
alias,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue