Merging upstream version 26.15.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2a79d9df75
commit
de6539b796
58 changed files with 4878 additions and 4677 deletions
|
@ -93,15 +93,18 @@ def remove_redundant_casts(expression: exp.Expression) -> exp.Expression:
|
|||
if (
|
||||
isinstance(expression, exp.Cast)
|
||||
and expression.this.type
|
||||
and expression.to.this == expression.this.type.this
|
||||
and expression.to == expression.this.type
|
||||
):
|
||||
return expression.this
|
||||
|
||||
if (
|
||||
isinstance(expression, (exp.Date, exp.TsOrDsToDate))
|
||||
and expression.this.type
|
||||
and expression.this.type.this == exp.DataType.Type.DATE
|
||||
and not expression.this.type.expressions
|
||||
):
|
||||
return expression.this
|
||||
|
||||
return expression
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ def unnest(select, parent_select, next_alias_name):
|
|||
.from_(select.subquery("_q", copy=False), copy=False)
|
||||
.group_by(exp.column(value.alias, "_q"), copy=False)
|
||||
)
|
||||
else:
|
||||
elif not find_in_scope(value.this, exp.AggFunc):
|
||||
select = select.group_by(value.this, copy=False)
|
||||
|
||||
parent_select.join(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue