mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
fixed arrayJoin, also functions on the original array should be working now [#CONV-7967]
This commit is contained in:
parent
f298f2698e
commit
c82710b275
@ -247,7 +247,7 @@ void ExpressionActions::Action::execute(Block & block) const
|
||||
{
|
||||
const ColumnWithNameAndType & current = block.getByPosition(i);
|
||||
|
||||
if (isArrayJoinedColumnName(current.name))
|
||||
if (current.name == source_name || isArrayJoinedColumnName(current.name))
|
||||
{
|
||||
if (!dynamic_cast<const DataTypeArray *>(&*current.type))
|
||||
throw Exception("arrayJoin of not array: " + current.name, ErrorCodes::TYPE_MISMATCH);
|
||||
@ -276,7 +276,7 @@ void ExpressionActions::Action::execute(Block & block) const
|
||||
{
|
||||
ColumnWithNameAndType & current = block.getByPosition(i);
|
||||
|
||||
if (isArrayJoinedColumnName(current.name))
|
||||
if (current.name == source_name || isArrayJoinedColumnName(current.name))
|
||||
{
|
||||
ColumnPtr array_ptr = current.column;
|
||||
if (array_ptr->isConst())
|
||||
|
@ -637,7 +637,11 @@ void ExpressionAnalyzer::getActionsImpl(ASTPtr ast, bool no_subqueries, bool onl
|
||||
ASTPtr arg = node->arguments->children[0];
|
||||
getActionsImpl(arg, no_subqueries, only_consts, actions_stack);
|
||||
if (!only_consts)
|
||||
actions_stack.addAction(ExpressionActions::Action::arrayJoin(arg->getColumnName(), node->getColumnName()));
|
||||
{
|
||||
String temp_name = "__array_joined__" + arg->getColumnName();
|
||||
actions_stack.addAction(ExpressionActions::Action::copyColumn(arg->getColumnName(), temp_name));
|
||||
actions_stack.addAction(ExpressionActions::Action::arrayJoin(temp_name, node->getColumnName()));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user