This commit is contained in:
kssenii 2021-04-20 08:38:14 +00:00
parent b43656bf89
commit f4d663bc56

View File

@ -201,6 +201,16 @@ def test_write_gzip_storage(started_cluster):
assert started_cluster.hdfs_api.read_gzip_data("/gzip_storage") == "1\tMark\t72.53\n"
assert node1.query("select * from GZIPHDFSStorage") == "1\tMark\t72.53\n"
def test_virtual_columns(started_cluster):
node1.query("create table virtual_cols (id UInt32) ENGINE = HDFS('hdfs://hdfs1:9000/file*', 'TSV')")
started_cluster.hdfs_api.write_data("/file1", "1\n")
started_cluster.hdfs_api.write_data("/file2", "2\n")
started_cluster.hdfs_api.write_data("/file3", "3\n")
expected = "1\tfile1\thdfs://hdfs1:9000//file1\n2\tfile2\thdfs://hdfs1:9000//file2\n3\tfile3\thdfs://hdfs1:9000//file3\n"
assert node1.query("select id, _file as file_name, _path as file_path from virtual_cols order by id") == expected
if __name__ == '__main__':
cluster.start()
input("Cluster created, press any key to destroy...")