Skip to content

Commit

Permalink
Make test integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Avogar committed Aug 22, 2023
1 parent 89b402f commit 30e8e4f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
29 changes: 29 additions & 0 deletions tests/integration/test_storage_s3/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,3 +1890,32 @@ def test_read_subcolumns(started_cluster):
assert (
res == "42\t/root/test_subcolumns.jsonl\t(42,42)\ttest_subcolumns.jsonl\t42\n"
)


def test_filtering_by_file_or_path(started_cluster):
bucket = started_cluster.minio_bucket
instance = started_cluster.instances["dummy"]

instance.query(
f"insert into function s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test_filter1.tsv', auto, 'x UInt64') select 1"
)

instance.query(
f"insert into function s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test_filter2.tsv', auto, 'x UInt64') select 2"
)

instance.query(
f"insert into function s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test_filter3.tsv', auto, 'x UInt64') select 3"
)

instance.query(
f"select count() from s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test_filter*.tsv') where _file = 'test_filter1.tsv'"
)

instance.query("SYSTEM FLUSH LOGS")

result = instance.query(
f"SELECT ProfileEvents['EngineFileLikeReadFiles'] FROM system.query_log WHERE query like '%select%s3%test_filter%' AND type='QueryFinish'"
)

assert int(result) == 1

This file was deleted.

This file was deleted.

0 comments on commit 30e8e4f

Please sign in to comment.