mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Fix tests
This commit is contained in:
parent
26e5d9a867
commit
13dd79f5b2
@ -111,7 +111,7 @@ def test_storage_with_multidirectory_glob(started_cluster):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
node1.query(
|
node1.query(
|
||||||
"SELECT * FROM hdfs('hdfs://hdfs1:9000/multiglob/{p4/path1,p2/path3}/postfix/data{1,2}.nonexist', TSV)"
|
"SELECT * FROM hdfs('hdfs://hdfs1:9000/multiglob/{p4/path1,p2/path3}/postfix/data{1,2}.nonexist', TSV) SETTINGS hdfs_throw_on_zero_files_match=0"
|
||||||
)
|
)
|
||||||
assert False, "Exception have to be thrown"
|
assert False, "Exception have to be thrown"
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
@ -220,14 +220,14 @@ def test_globs_in_read_table(started_cluster):
|
|||||||
)
|
)
|
||||||
print("inside_table_func ", inside_table_func)
|
print("inside_table_func ", inside_table_func)
|
||||||
assert (
|
assert (
|
||||||
node1.query("select * from hdfs(" + inside_table_func + ")")
|
node1.query("select * from hdfs(" + inside_table_func + ") settings hdfs_throw_on_zero_files_match=0")
|
||||||
== paths_amount * some_data
|
== paths_amount * some_data
|
||||||
)
|
)
|
||||||
assert node1.query(
|
assert node1.query(
|
||||||
"select count(distinct _path) from hdfs(" + inside_table_func + ")"
|
"select count(distinct _path) from hdfs(" + inside_table_func + ") settings hdfs_throw_on_zero_files_match=0"
|
||||||
).rstrip() == str(paths_amount)
|
).rstrip() == str(paths_amount)
|
||||||
assert node1.query(
|
assert node1.query(
|
||||||
"select count(distinct _file) from hdfs(" + inside_table_func + ")"
|
"select count(distinct _file) from hdfs(" + inside_table_func + ") settings hdfs_throw_on_zero_files_match=0"
|
||||||
).rstrip() == str(files_amount)
|
).rstrip() == str(files_amount)
|
||||||
|
|
||||||
|
|
||||||
@ -635,6 +635,7 @@ def test_cluster_join(started_cluster):
|
|||||||
SELECT l.id,r.id FROM hdfsCluster('test_cluster_two_shards', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32') as l
|
SELECT l.id,r.id FROM hdfsCluster('test_cluster_two_shards', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32') as l
|
||||||
JOIN hdfsCluster('test_cluster_two_shards', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32') as r
|
JOIN hdfsCluster('test_cluster_two_shards', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32') as r
|
||||||
ON l.id = r.id
|
ON l.id = r.id
|
||||||
|
SETTINGS hdfs_throw_on_zero_files_match=0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
assert "AMBIGUOUS_COLUMN_NAME" not in result
|
assert "AMBIGUOUS_COLUMN_NAME" not in result
|
||||||
@ -643,13 +644,13 @@ def test_cluster_join(started_cluster):
|
|||||||
def test_cluster_macro(started_cluster):
|
def test_cluster_macro(started_cluster):
|
||||||
with_macro = node1.query(
|
with_macro = node1.query(
|
||||||
"""
|
"""
|
||||||
SELECT id FROM hdfsCluster('{default_cluster_macro}', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32')
|
SELECT id FROM hdfsCluster('{default_cluster_macro}', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32') SETTINGS hdfs_throw_on_zero_files_match=0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
no_macro = node1.query(
|
no_macro = node1.query(
|
||||||
"""
|
"""
|
||||||
SELECT id FROM hdfsCluster('test_cluster_two_shards', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32')
|
SELECT id FROM hdfsCluster('test_cluster_two_shards', 'hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32') SETTINGS hdfs_throw_on_zero_files_match=0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,5 +3,5 @@ drop table if exists test_02481_mismatch_files;
|
|||||||
create table test_02481_mismatch_files (a UInt64, b String) engine = S3(s3_conn, filename='test_02481_mismatch_files_{_partition_id}', format=Parquet) partition by a;
|
create table test_02481_mismatch_files (a UInt64, b String) engine = S3(s3_conn, filename='test_02481_mismatch_files_{_partition_id}', format=Parquet) partition by a;
|
||||||
set s3_truncate_on_insert=1;
|
set s3_truncate_on_insert=1;
|
||||||
insert into test_02481_mismatch_files values (1, 'a'), (22, 'b'), (333, 'c');
|
insert into test_02481_mismatch_files values (1, 'a'), (22, 'b'), (333, 'c');
|
||||||
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet); -- { serverError CANNOT_EXTRACT_TABLE_STRUCTURE }
|
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet) settings s3_throw_on_zero_files_match=0; -- { serverError CANNOT_EXTRACT_TABLE_STRUCTURE }
|
||||||
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet) settings s3_throw_on_zero_files_match=1; -- { serverError FILE_DOESNT_EXIST }
|
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet); -- { serverError FILE_DOESNT_EXIST }
|
||||||
|
@ -7,6 +7,6 @@ create table test_02481_mismatch_files (a UInt64, b String) engine = S3(s3_conn,
|
|||||||
set s3_truncate_on_insert=1;
|
set s3_truncate_on_insert=1;
|
||||||
insert into test_02481_mismatch_files values (1, 'a'), (22, 'b'), (333, 'c');
|
insert into test_02481_mismatch_files values (1, 'a'), (22, 'b'), (333, 'c');
|
||||||
|
|
||||||
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet); -- { serverError CANNOT_EXTRACT_TABLE_STRUCTURE }
|
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet) settings s3_throw_on_zero_files_match=0; -- { serverError CANNOT_EXTRACT_TABLE_STRUCTURE }
|
||||||
|
|
||||||
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet) settings s3_throw_on_zero_files_match=1; -- { serverError FILE_DOESNT_EXIST }
|
select a, b from s3(s3_conn, filename='test_02481_mismatch_filesxxx*', format=Parquet); -- { serverError FILE_DOESNT_EXIST }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-- Tags: no-fasttest
|
-- Tags: no-fasttest
|
||||||
|
|
||||||
select * from s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/MyPrefix/BU%20-%20UNIT%20-%201/*.parquet'); -- { serverError CANNOT_EXTRACT_TABLE_STRUCTURE }
|
select * from s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/MyPrefix/BU%20-%20UNIT%20-%201/*.parquet', NOSIGN) settings s3_throw_on_zero_files_match=0; -- { serverError CANNOT_EXTRACT_TABLE_STRUCTURE }
|
||||||
|
|
||||||
select * from s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/MyPrefix/*.parquet?some_tocken=ABCD'); -- { serverError CANNOT_DETECT_FORMAT }
|
select * from s3('https://datasets-documentation.s3.eu-west-3.amazonaws.com/MyPrefix/*.parquet?some_tocken=ABCD', NOSIGN) settings s3_throw_on_zero_files_match=0; -- { serverError CANNOT_DETECT_FORMAT }
|
||||||
|
Loading…
Reference in New Issue
Block a user