"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_query="insert into table function s3('http://{}:{}/{}/test.csv', 'CSV', '{}') values {}".format(mock_host,preserving_data_port,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)
check_queries=[
"select *, column1*column2*column3 from s3('http://{}:{}/{}/test.csv', 'CSV', '{}')".format(mock_host,preserving_data_port,bucket,format),
]
try:
logging.info('Phase 1')
forqueryinprepare_put_queries:
run_query(query)
logging.info('Phase 2')
forqueryinqueries:
stdout=run_query(query)
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)
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)
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)