Add support for INCLUDE/EXCLUDE NULLS for UNPIVOT (#1849)

This commit is contained in:
Denys Tsomenko 2025-05-15 17:40:21 +03:00 committed by GitHub
parent c6e897dc12
commit 3c59950060
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 111 additions and 44 deletions

View file

@ -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,