-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marcel Coetzee <[email protected]>
- Loading branch information
Showing
7 changed files
with
125 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from dlt.common.arithmetics import DEFAULT_NUMERIC_PRECISION, DEFAULT_NUMERIC_SCALE | ||
from dlt.common.data_writers.escape import escape_clickhouse_identifier, escape_clickhouse_literal | ||
from dlt.common.destination import DestinationCapabilitiesContext | ||
|
||
|
||
def capabilities() -> DestinationCapabilitiesContext: | ||
caps = DestinationCapabilitiesContext() | ||
caps.preferred_loader_file_format = "jsonl" | ||
caps.supported_loader_file_formats = ["jsonl", "parquet"] | ||
caps.preferred_staging_file_format = "parquet" | ||
caps.supported_staging_file_formats = ["parquet", "jsonl"] | ||
caps.escape_identifier = escape_clickhouse_identifier | ||
caps.escape_literal = escape_clickhouse_literal | ||
caps.decimal_precision = (DEFAULT_NUMERIC_PRECISION, DEFAULT_NUMERIC_SCALE) | ||
caps.wei_precision = (76, 38) | ||
caps.max_identifier_length = 1024 | ||
caps.max_column_identifier_length = 300 | ||
caps.max_query_length = 1024 * 1024 | ||
caps.is_max_query_length_in_bytes = False | ||
caps.max_text_data_type_length = 10 * 1024 * 1024 | ||
caps.is_max_text_data_type_length_in_bytes = True | ||
caps.supports_ddl_transactions = False | ||
|
||
return caps |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from typing import TYPE_CHECKING, ClassVar, List, Optional, Final | ||
|
||
from dlt.common.configuration import configspec | ||
from dlt.common.destination.reference import DestinationClientDwhWithStagingConfiguration | ||
|
||
|
||
@configspec | ||
class ClickhouseClientConfiguration(DestinationClientDwhWithStagingConfiguration): | ||
destination_type: Final[str] = "clickhouse" # type: ignore | ||
|
||
http_timeout: float = 15.0 | ||
file_upload_timeout: float = 30 * 60.0 | ||
retry_deadline: float = 60.0 | ||
|
||
__config_gen_annotations__: ClassVar[List[str]] = [] | ||
|
||
if TYPE_CHECKING: | ||
|
||
def __init__( | ||
self, | ||
*, | ||
dataset_name: str = None, | ||
default_schema_name: Optional[str], | ||
http_timeout: float = 15.0, | ||
file_upload_timeout: float = 30 * 60.0, | ||
retry_deadline: float = 60.0, | ||
destination_name: str = None, | ||
environment: str = None | ||
) -> None: | ||
super().__init__( | ||
dataset_name=dataset_name, | ||
default_schema_name=default_schema_name, | ||
destination_name=destination_name, | ||
environment=environment, | ||
) | ||
self.retry_deadline = retry_deadline | ||
self.file_upload_timeout = file_upload_timeout | ||
self.http_timeout = http_timeout | ||
... |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters