Skip to content

Commit

Permalink
Fix(clickhouse): rename BOOLEAN type to Bool fixes #4230
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas committed Oct 9, 2024
1 parent 3f6ba3e commit 79caf51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ class Generator(generator.Generator):
**generator.Generator.TYPE_MAPPING,
**STRING_TYPE_MAPPING,
exp.DataType.Type.ARRAY: "Array",
exp.DataType.Type.BOOLEAN: "Bool",
exp.DataType.Type.BIGINT: "Int64",
exp.DataType.Type.DATE32: "Date32",
exp.DataType.Type.DATETIME: "DateTime",
Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_clickhouse(self):
self.assertEqual(expr.sql(dialect="clickhouse"), "COUNT(x)")
self.assertIsNone(expr._meta)

self.validate_identity("CAST(1 AS Bool)")
self.validate_identity("SELECT toString(CHAR(104.1, 101, 108.9, 108.9, 111, 32))")
self.validate_identity("@macro").assert_is(exp.Parameter).this.assert_is(exp.Var)
self.validate_identity("SELECT toFloat(like)")
Expand Down

0 comments on commit 79caf51

Please sign in to comment.