Added test with all signatures and fixed style check

This commit is contained in:
Smita Kulkarni 2023-07-17 17:18:14 +02:00
parent 195b29b4a0
commit 671f8b34d0
2 changed files with 52 additions and 1 deletions

View File

@ -611,3 +611,54 @@ def test_filter_using_file(cluster):
query = f"select count(*) from azureBlobStorage('http://azurite1:10000/devstoreaccount1', 'cont', 'test_partition_tf_*.csv', 'devstoreaccount1', 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV', 'auto', '{table_format}') WHERE _file='test_partition_tf_3.csv'" query = f"select count(*) from azureBlobStorage('http://azurite1:10000/devstoreaccount1', 'cont', 'test_partition_tf_*.csv', 'devstoreaccount1', 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV', 'auto', '{table_format}') WHERE _file='test_partition_tf_3.csv'"
assert azure_query(node, query) == "1\n" assert azure_query(node, query) == "1\n"
def test_function_signatures(cluster):
node = cluster.instances["node"]
connection_string = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite1:10000/devstoreaccount1;'
storage_account_url = "http://azurite1:10000/devstoreaccount1"
account_name = "devstoreaccount1"
account_key = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
azure_query(
node,
f"INSERT INTO TABLE FUNCTION azureBlobStorage('{storage_account_url}', 'cont', 'test_signature.csv', '{account_name}', '{account_key}', 'CSV', 'auto', 'column1 UInt32') VALUES (1),(2),(3)",
)
#" - connection_string, container_name, blobpath\n"
query_1 = f"select * from azureBlobStorage('{connection_string}', 'cont', 'test_signature.csv')"
assert azure_query(node, query_1) == "1\n2\n3\n"
#" - connection_string, container_name, blobpath, structure \n"
query_2 = f"select * from azureBlobStorage('{connection_string}', 'cont', 'test_signature.csv', 'column1 UInt32')"
assert azure_query(node, query_2) == "1\n2\n3\n"
#" - connection_string, container_name, blobpath, format \n"
query_3 = f"select * from azureBlobStorage('{connection_string}', 'cont', 'test_signature.csv', 'CSV')"
assert azure_query(node, query_3) == "1\n2\n3\n"
#" - connection_string, container_name, blobpath, format, compression \n"
query_4 = f"select * from azureBlobStorage('{connection_string}', 'cont', 'test_signature.csv', 'CSV', 'auto')"
assert azure_query(node, query_4) == "1\n2\n3\n"
#" - connection_string, container_name, blobpath, format, compression, structure \n"
query_5 = f"select * from azureBlobStorage('{connection_string}', 'cont', 'test_signature.csv', 'CSV', 'auto', 'column1 UInt32')"
assert azure_query(node, query_5) == "1\n2\n3\n"
#" - storage_account_url, container_name, blobpath, account_name, account_key\n"
query_6 = f"select * from azureBlobStorage('{storage_account_url}', 'cont', 'test_signature.csv', '{account_name}', '{account_key}')"
assert azure_query(node, query_6) == "1\n2\n3\n"
#" - storage_account_url, container_name, blobpath, account_name, account_key, structure\n"
query_7 = f"select * from azureBlobStorage('{storage_account_url}', 'cont', 'test_signature.csv', '{account_name}', '{account_key}', 'column1 UInt32')"
assert azure_query(node, query_7) == "1\n2\n3\n"
#" - storage_account_url, container_name, blobpath, account_name, account_key, format\n"
query_8 = f"select * from azureBlobStorage('{storage_account_url}', 'cont', 'test_signature.csv', '{account_name}', '{account_key}', 'CSV')"
assert azure_query(node, query_8) == "1\n2\n3\n"
#" - storage_account_url, container_name, blobpath, account_name, account_key, format, compression\n"
query_9 = f"select * from azureBlobStorage('{storage_account_url}', 'cont', 'test_signature.csv', '{account_name}', '{account_key}', 'CSV', 'auto')"
assert azure_query(node, query_9) == "1\n2\n3\n"
#" - storage_account_url, container_name, blobpath, account_name, account_key, format, compression, structure\n"
query_10 = f"select * from azureBlobStorage('{storage_account_url}', 'cont', 'test_signature.csv', '{account_name}', '{account_key}', 'CSV', 'auto', 'column1 UInt32')"
assert azure_query(node, query_10) == "1\n2\n3\n"