Skip to content

Commit

Permalink
Fix: coalesce simplify window func
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed Aug 14, 2023
1 parent 2e73a4f commit 8affeff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sqlglot/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3313,7 +3313,7 @@ class Pivot(Expression):
}


class Window(Expression):
class Window(Condition):
arg_types = {
"this": True,
"partition_by": False,
Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/optimizer/simplify.sql
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ x = 1 OR x IS NULL;
COALESCE(x, 1) IS NULL;
FALSE;

COALESCE(ROW() OVER (), 1) = 1;
ROW() OVER () = 1 OR ROW() OVER () IS NULL;

--------------------------------------
-- CONCAT
--------------------------------------
Expand Down

0 comments on commit 8affeff

Please sign in to comment.