Skip to content

Commit

Permalink
Map integer into int64 field (shaped-ai#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
BTheunissen authored Nov 9, 2023
1 parent 128a446 commit 8b9f08b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "shaped-target-clickhouse"
version = "0.1.4"
version = "0.1.5"
description = "`target-clickhouse` is a Singer target for clickhouse, built with the Meltano Singer SDK."
readme = "README.md"
authors = ["Ben Theunissen"]
Expand Down
7 changes: 7 additions & 0 deletions target_clickhouse/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from clickhouse_sqlalchemy import (
Table,
)
from clickhouse_sqlalchemy import (
types as clickhouse_sqlalchemy_types,
)
from pkg_resources import get_distribution, parse_version
from singer_sdk import typing as th
from singer_sdk.connectors import SQLConnector
Expand Down Expand Up @@ -62,6 +65,10 @@ def to_sql_type(self, jsonschema_type: dict) -> sqlalchemy.types.TypeEngine:
sql_type = typing.cast(
sqlalchemy.types.TypeEngine, sqlalchemy.types.FLOAT(),
)
elif type(sql_type) == sqlalchemy.types.INTEGER:
sql_type = typing.cast(
sqlalchemy.types.TypeEngine, clickhouse_sqlalchemy_types.Int64(),
)

return sql_type

Expand Down

0 comments on commit 8b9f08b

Please sign in to comment.