mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Update PushingToViewsBlockOutputStream
This commit is contained in:
parent
9635c8d5c5
commit
50f66433e0
@ -60,9 +60,16 @@ PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream(
|
||||
std::unique_ptr<ASTInsertQuery> insert = std::make_unique<ASTInsertQuery>();
|
||||
insert->database = inner_table_id.database_name;
|
||||
insert->table = inner_table_id.table_name;
|
||||
//
|
||||
// Context local_context = *views_context;
|
||||
// local_context.addViewSource(
|
||||
// StorageValues::create(storage->getStorageID(), storage->getColumns(),
|
||||
// storage->getSampleBlock()));
|
||||
auto header = InterpreterSelectQuery(query, *views_context, SelectQueryOptions().analyze())
|
||||
.getSampleBlock();
|
||||
|
||||
auto list = std::make_shared<ASTExpressionList>();
|
||||
for (auto & column : storage->getSampleBlock())
|
||||
for (auto & column : header)
|
||||
list->children.emplace_back(std::make_shared<ASTIdentifier>(column.name));
|
||||
|
||||
insert->columns = std::move(list);
|
||||
|
Loading…
Reference in New Issue
Block a user