Fix and add a test

This commit is contained in:
avogar 2023-01-23 16:24:00 +00:00
parent eed1db7e07
commit 73538117eb
4 changed files with 13 additions and 2 deletions

View File

@ -109,7 +109,7 @@ StoragePtr TableFunctionHDFSCluster::getStorage(
storage = std::make_shared<StorageHDFSCluster>(
context,
cluster_name, filename, StorageID(getDatabaseName(), table_name),
format, getActualTableStructure(context), ConstraintsDescription{},
format, columns, ConstraintsDescription{},
compression_method, structure != "auto");
}
return storage;

View File

@ -28,7 +28,6 @@ public:
{
return name;
}
bool hasStaticStructure() const override { return true; }
protected:
StoragePtr getStorage(

View File

@ -0,0 +1,11 @@
-- Tags: no-fasttest, no-parallel, no-cpu-aarch64
-- Tag no-fasttest: Depends on Java
insert into table function hdfs('hdfs://localhost:12222/test_02536.jsonl', 'TSV') select '{"x" : {"a" : 1, "b" : 2}}' settings hdfs_truncate_on_insert=1;
drop table if exists test;
create table test (x Tuple(a UInt32, b UInt32)) engine=Memory();
insert into test select * from hdfsCluster('test_cluster_two_shards_localhost', 'hdfs://localhost:12222/test_02536.jsonl') settings use_structure_from_insertion_table_in_table_functions=0; -- {serverError TYPE_MISMATCH}
insert into test select * from hdfsCluster('test_cluster_two_shards_localhost', 'hdfs://localhost:12222/test_02536.jsonl') settings use_structure_from_insertion_table_in_table_functions=1;
select * from test;
drop table test;