From fdd052ad44e754288cb97f984ccc63b8dd1c6b97 Mon Sep 17 00:00:00 2001 From: Marcel Coetzee Date: Fri, 5 Apr 2024 14:59:57 +0200 Subject: [PATCH] Remove from standard sql tests Signed-off-by: Marcel Coetzee --- dlt/destinations/impl/clickhouse/__init__.py | 4 ++-- dlt/destinations/impl/clickhouse/clickhouse.py | 13 +++++-------- tests/load/utils.py | 1 - 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/dlt/destinations/impl/clickhouse/__init__.py b/dlt/destinations/impl/clickhouse/__init__.py index 6136e0078d..1ade9649cd 100644 --- a/dlt/destinations/impl/clickhouse/__init__.py +++ b/dlt/destinations/impl/clickhouse/__init__.py @@ -8,8 +8,8 @@ def capabilities() -> DestinationCapabilitiesContext: caps = DestinationCapabilitiesContext() # Clickhouse only supports loading from staged files on s3 for now. - caps.preferred_loader_file_format = "jsonl" - caps.supported_loader_file_formats = ["parquet", "jsonl"] + caps.preferred_loader_file_format = "insert_values" + caps.supported_loader_file_formats = ["insert_values"] caps.preferred_staging_file_format = "jsonl" caps.supported_staging_file_formats = ["parquet", "jsonl"] diff --git a/dlt/destinations/impl/clickhouse/clickhouse.py b/dlt/destinations/impl/clickhouse/clickhouse.py index 3e75025be6..3b44168305 100644 --- a/dlt/destinations/impl/clickhouse/clickhouse.py +++ b/dlt/destinations/impl/clickhouse/clickhouse.py @@ -7,7 +7,6 @@ from jinja2 import Template import dlt -from dlt import config from dlt.common.configuration.specs import ( CredentialsConfiguration, AzureCredentialsWithoutDefaults, @@ -241,13 +240,11 @@ def __init__( ) elif not bucket_path: # Local filesystem. - if not file_path: - raise LoadJobTerminalException( - file_path, - "If `bucket_path` isn't provided, then you must specify a local file path.", - ) - print(file_path) - table_function = f"FROM INFILE '{file_path}' FORMAT {clickhouse_format}" + raise LoadJobTerminalException( + file_path, + "Cannot load from local file. Clickhouse does not support loading from local files." + " Configure staging with an s3, gcs or azure storage bucket.", + ) else: raise LoadJobTerminalException( file_path, diff --git a/tests/load/utils.py b/tests/load/utils.py index 93055cbd2b..2c7d89f822 100644 --- a/tests/load/utils.py +++ b/tests/load/utils.py @@ -200,7 +200,6 @@ def destinations_configs( destination_configs += [ DestinationTestConfiguration( destination="clickhouse", - file_format="jsonl", disable_compression=True, ) ]