Skip to content

Commit

Permalink
fix: duckdb ISNAN (#2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
barakalon authored Aug 10, 2023
1 parent ea7891d commit 325b26e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ class Generator(generator.Generator):
exp.Encode: lambda self, e: encode_decode_sql(self, e, "ENCODE", replace=False),
exp.Explode: rename_func("UNNEST"),
exp.IntDiv: lambda self, e: self.binary(e, "//"),
exp.IsNan: rename_func("ISNAN"),
exp.JSONExtract: arrow_json_extract_sql,
exp.JSONExtractScalar: arrow_json_extract_scalar_sql,
exp.JSONFormat: _json_format_sql,
Expand Down
2 changes: 2 additions & 0 deletions tests/dialects/test_duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ def test_duckdb(self):
unsupported_level=ErrorLevel.IMMEDIATE,
)

self.validate_identity("SELECT ISNAN(x)")

def test_time(self):
self.validate_identity("SELECT CURRENT_DATE")
self.validate_identity("SELECT CURRENT_TIMESTAMP")
Expand Down

0 comments on commit 325b26e

Please sign in to comment.