mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix for analyzer
This commit is contained in:
parent
93c49dfeaa
commit
b9c28ef1f7
@ -6247,7 +6247,7 @@ void QueryAnalyzer::resolveTableFunction(QueryTreeNodePtr & table_function_node,
|
|||||||
.getTable(insertion_table, scope_context)
|
.getTable(insertion_table, scope_context)
|
||||||
->getInMemoryMetadataPtr()
|
->getInMemoryMetadataPtr()
|
||||||
->getColumns();
|
->getColumns();
|
||||||
const auto & insert_column_names = insert_columns.getInsertable().getNames();
|
const auto & insert_column_names = scope_context->hasInsertionTableColumnNames() ? *scope_context->getInsertionTableColumnNames() : insert_columns.getInsertable().getNames();
|
||||||
DB::ColumnsDescription structure_hint;
|
DB::ColumnsDescription structure_hint;
|
||||||
|
|
||||||
bool use_columns_from_insert_query = true;
|
bool use_columns_from_insert_query = true;
|
||||||
|
@ -1592,7 +1592,7 @@ StoragePtr Context::executeTableFunction(const ASTPtr & table_expression, const
|
|||||||
->getInMemoryMetadataPtr()
|
->getInMemoryMetadataPtr()
|
||||||
->getColumns();
|
->getColumns();
|
||||||
|
|
||||||
const auto & insert_column_names = hasInsertionTableColumnNames() ? getInsertionTableColumnNames() : insert_columns.getInsertable().getNames();
|
const auto & insert_column_names = hasInsertionTableColumnNames() ? *getInsertionTableColumnNames() : insert_columns.getInsertable().getNames();
|
||||||
DB::ColumnsDescription structure_hint;
|
DB::ColumnsDescription structure_hint;
|
||||||
|
|
||||||
bool use_columns_from_insert_query = true;
|
bool use_columns_from_insert_query = true;
|
||||||
|
@ -723,11 +723,7 @@ public:
|
|||||||
bool hasInsertionTableColumnNames() const { return insertion_table_info.column_names.has_value(); }
|
bool hasInsertionTableColumnNames() const { return insertion_table_info.column_names.has_value(); }
|
||||||
void setInsertionTable(StorageID db_and_table, const std::optional<Names> & column_names = std::nullopt) { insertion_table_info = {std::move(db_and_table), column_names}; }
|
void setInsertionTable(StorageID db_and_table, const std::optional<Names> & column_names = std::nullopt) { insertion_table_info = {std::move(db_and_table), column_names}; }
|
||||||
const StorageID & getInsertionTable() const { return insertion_table_info.table; }
|
const StorageID & getInsertionTable() const { return insertion_table_info.table; }
|
||||||
const Names & getInsertionTableColumnNames() const
|
const std::optional<Names> & getInsertionTableColumnNames() const{ return insertion_table_info.column_names; }
|
||||||
{
|
|
||||||
assert(insertion_table_info.column_names.has_value());
|
|
||||||
return *insertion_table_info.column_names;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setDistributed(bool is_distributed_) { is_distributed = is_distributed_; }
|
void setDistributed(bool is_distributed_) { is_distributed = is_distributed_; }
|
||||||
bool isDistributed() const { return is_distributed; }
|
bool isDistributed() const { return is_distributed; }
|
||||||
|
@ -474,7 +474,7 @@ BlockIO InterpreterInsertQuery::execute()
|
|||||||
|
|
||||||
auto new_context = Context::createCopy(context);
|
auto new_context = Context::createCopy(context);
|
||||||
new_context->setSettings(new_settings);
|
new_context->setSettings(new_settings);
|
||||||
new_context->setInsertionTable(getContext()->getInsertionTable());
|
new_context->setInsertionTable(getContext()->getInsertionTable(), getContext()->getInsertionTableColumnNames());
|
||||||
|
|
||||||
auto select_query_options = SelectQueryOptions(QueryProcessingStage::Complete, 1);
|
auto select_query_options = SelectQueryOptions(QueryProcessingStage::Complete, 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user