Support PREWHERE condition for ClickHouse dialect (#1328)

This commit is contained in:
hulk 2024-07-07 20:03:23 +08:00 committed by GitHub
parent 700bd03d6f
commit 0884dd920d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 94 additions and 0 deletions

View file

@ -8329,6 +8329,14 @@ impl<'a> Parser<'a> {
}
}
let prewhere = if dialect_of!(self is ClickHouseDialect|GenericDialect)
&& self.parse_keyword(Keyword::PREWHERE)
{
Some(self.parse_expr()?)
} else {
None
};
let selection = if self.parse_keyword(Keyword::WHERE) {
Some(self.parse_expr()?)
} else {
@ -8440,6 +8448,7 @@ impl<'a> Parser<'a> {
into,
from,
lateral_views,
prewhere,
selection,
group_by,
cluster_by,