mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-30 05:30:51 +00:00
ISSUES-2906 support join for table function
This commit is contained in:
parent
83ceeca199
commit
cdc4c65adc
@ -669,7 +669,8 @@ static std::shared_ptr<InterpreterSelectWithUnionQuery> interpretSubquery(
|
||||
/// get columns list for target table
|
||||
if (function)
|
||||
{
|
||||
const auto & storage = const_cast<Context *>(&context)->executeTableFunction(table_expression);
|
||||
auto query_context = const_cast<Context *>(&context.getQueryContext());
|
||||
const auto & storage = query_context->executeTableFunction(table_expression);
|
||||
columns = storage->getColumns().ordinary;
|
||||
select_query->addTableFunction(*const_cast<ASTPtr *>(&table_expression));
|
||||
}
|
||||
@ -2467,7 +2468,8 @@ NamesAndTypesList ExpressionAnalyzer::AnalyzedJoin::getColumnsFromJoinedTable(co
|
||||
else if (table_expression.table_function)
|
||||
{
|
||||
const auto table_function = table_expression.table_function;
|
||||
const auto join_storage = const_cast<Context *>(&context.getQueryContext())->executeTableFunction(table_function);
|
||||
auto query_context = const_cast<Context *>(&context.getQueryContext());
|
||||
const auto & join_storage = query_context->executeTableFunction(table_function);
|
||||
nested_result_sample = join_storage->getSampleBlockNonMaterialized();
|
||||
}
|
||||
else if (table_expression.database_and_table_name)
|
||||
|
@ -351,7 +351,10 @@ ASTs PredicateExpressionsOptimizer::evaluateAsterisk(ASTSelectQuery * select_que
|
||||
StoragePtr storage;
|
||||
|
||||
if (table_expression->table_function)
|
||||
storage = const_cast<Context &>(context).executeTableFunction(table_expression->table_function);
|
||||
{
|
||||
auto query_context = const_cast<Context *>(&context.getQueryContext());
|
||||
storage = query_context->executeTableFunction(table_expression->table_function);
|
||||
}
|
||||
else if (table_expression->database_and_table_name)
|
||||
{
|
||||
const auto database_and_table_ast = static_cast<ASTIdentifier*>(table_expression->database_and_table_name.get());
|
||||
|
Loading…
Reference in New Issue
Block a user