mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
Add test
This commit is contained in:
parent
003b807b00
commit
7d7277a7c6
@ -1038,3 +1038,25 @@ def test_signatures(started_cluster):
|
||||
result = instance.query(f"select * from s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test.arrow', 'minio', 'minio123', 'Arrow')")
|
||||
assert(int(result) == 1)
|
||||
|
||||
|
||||
def test_select_columns(started_cluster):
|
||||
bucket = started_cluster.minio_bucket
|
||||
instance = started_cluster.instances["dummy"]
|
||||
name = "test_table"
|
||||
structure = "id UInt32, value1 Int32, value2 Int32"
|
||||
|
||||
instance.query(f"drop table if exists {name}")
|
||||
instance.query(f"CREATE TABLE {name} ({structure}) ENGINE = S3(s3_conf1, format='Parquet')")
|
||||
|
||||
limit = 10000000
|
||||
instance.query(f"INSERT INTO {name} SELECT * FROM generateRandom('{structure}') LIMIT {limit}")
|
||||
instance.query(f"SELECT value2 FROM {name}")
|
||||
|
||||
instance.query("SYSTEM FLUSH LOGS")
|
||||
result1 = instance.query(f"SELECT read_bytes FROM system.query_log WHERE type='QueryFinish' and query LIKE 'SELECT value2 FROM {name}'")
|
||||
|
||||
instance.query(f"SELECT * FROM {name}")
|
||||
instance.query("SYSTEM FLUSH LOGS")
|
||||
result2 = instance.query(f"SELECT read_bytes FROM system.query_log WHERE type='QueryFinish' and query LIKE 'SELECT * FROM {name}'")
|
||||
|
||||
assert(int(result1) * 3 <= int(result2))
|
||||
|
Loading…
Reference in New Issue
Block a user