"insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') values {}".format(mock_host,preserving_data_port,bucket,format,values),
]
queries=[
"select *, column1*column2*column3 from s3('http://{}:{}/', 'CSV', '{}')".format(mock_host,redirecting_to_http_port,format),
put_communication_data(started_cluster,'=== Get with redirect test ===')
query="select *, column1*column2*column3 from s3('http://{}:{}/', 'CSV', '{}')".format(started_cluster.mock_host,started_cluster.redirecting_to_http_port,format)
stdout=run_query(instance,query)
assertlist(map(str.split,stdout.splitlines()))==[
['42','87','44','160776'],
['55','33','81','147015'],
['1','0','9','0'],
]
put_query="insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') values {}".format(mock_host,preserving_data_port,bucket,format,values)
put_communication_data(started_cluster,'=== Put test ===')
values='(1, 2, 3), (3, 2, 1), (78, 43, 45)'
put_query="insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') values {}".format(started_cluster.mock_host,started_cluster.preserving_data_port,started_cluster.bucket,format,values)
redirect_put_query="insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') values {}".format(mock_host,redirecting_preserving_data_port,bucket,format,other_values)
put_communication_data(started_cluster,'=== Put test CSV ===')
put_query="insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') format CSV".format(started_cluster.mock_host,started_cluster.preserving_data_port,started_cluster.bucket,format)
put_communication_data(started_cluster,'=== Put with redirect test ===')
other_values='(1, 1, 1), (1, 1, 1), (11, 11, 11)'
query="insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') values {}".format(started_cluster.mock_host,started_cluster.redirecting_preserving_data_port,started_cluster.bucket,format,other_values)
run_query(instance,query)
query="select *, column1*column2*column3 from s3('http://{}:{}/{}/test.csv', 'CSV', '{}')".format(started_cluster.mock_host,started_cluster.preserving_data_port,started_cluster.bucket,format)
put_query="insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') format CSV".format(started_cluster.mock_host,started_cluster.multipart_preserving_data_port,started_cluster.bucket,format)