mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #53426 from ClickHouse/analyzer-fix-virtuals-distr
Analyzer: fix virtual columns in StorageDistributed
This commit is contained in:
commit
cac2628b41
@ -691,7 +691,11 @@ QueryTreeNodePtr buildQueryTreeDistributed(SelectQueryInfo & query_info,
|
||||
if (remote_storage_id.hasDatabase())
|
||||
resolved_remote_storage_id = query_context->resolveStorageID(remote_storage_id);
|
||||
|
||||
auto storage = std::make_shared<StorageDummy>(resolved_remote_storage_id, distributed_storage_snapshot->metadata->getColumns(), distributed_storage_snapshot->object_columns);
|
||||
auto get_column_options = GetColumnsOptions(GetColumnsOptions::All).withExtendedObjects().withVirtuals();
|
||||
|
||||
auto column_names_and_types = distributed_storage_snapshot->getColumns(get_column_options);
|
||||
|
||||
auto storage = std::make_shared<StorageDummy>(resolved_remote_storage_id, ColumnsDescription{column_names_and_types});
|
||||
auto table_node = std::make_shared<TableNode>(std::move(storage), query_context);
|
||||
|
||||
if (table_expression_modifiers)
|
||||
|
@ -0,0 +1,5 @@
|
||||
drop table if exists data_01072;
|
||||
drop table if exists dist_01072;
|
||||
create table data_01072 (key Int) Engine=MergeTree() ORDER BY key;
|
||||
create table dist_01072 (key Int) Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01072, key);
|
||||
select * from dist_01072 where key=0 and _part='0';
|
Loading…
Reference in New Issue
Block a user