mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
remove a trick with expression continuation
This commit is contained in:
parent
0e49a9ed4d
commit
bfe30a9723
@ -44,33 +44,4 @@ Block ExpressionBlockInputStream::readImpl()
|
||||
return res;
|
||||
}
|
||||
|
||||
Block InflatingExpressionBlockInputStream::readImpl()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
if (expression->resultIsAlwaysEmpty())
|
||||
return {};
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
Block res;
|
||||
bool keep_going = not_processed && not_processed->empty(); /// There's data inside expression.
|
||||
|
||||
if (!not_processed || keep_going)
|
||||
{
|
||||
not_processed.reset();
|
||||
|
||||
res = children.back()->read();
|
||||
if (res || keep_going)
|
||||
expression->execute(res, not_processed, action_number);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = std::move(not_processed->block);
|
||||
expression->execute(res, not_processed, action_number);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -676,19 +676,13 @@ void ExpressionActions::execute(Block & block, bool dry_run) const
|
||||
}
|
||||
}
|
||||
|
||||
/// @warning It's a tricky method that allows to continue ONLY ONE action in reason of one-to-many ALL JOIN logic.
|
||||
void ExpressionActions::execute(Block & block, ExtraBlockPtr & not_processed, size_t & start_action) const
|
||||
void ExpressionActions::execute(Block & block, ExtraBlockPtr & not_processed) const
|
||||
{
|
||||
size_t i = start_action;
|
||||
start_action = 0;
|
||||
for (; i < actions.size(); ++i)
|
||||
{
|
||||
actions[i].execute(block, false, not_processed);
|
||||
checkLimits(block);
|
||||
if (actions.size() != 1)
|
||||
throw Exception("Continuation over multiple expressions is not supported", ErrorCodes::LOGICAL_ERROR);
|
||||
|
||||
if (not_processed)
|
||||
start_action = i;
|
||||
}
|
||||
actions[0].execute(block, false, not_processed);
|
||||
checkLimits(block);
|
||||
}
|
||||
|
||||
bool ExpressionActions::hasJoinOrArrayJoin() const
|
||||
|
@ -212,7 +212,7 @@ public:
|
||||
void execute(Block & block, bool dry_run = false) const;
|
||||
|
||||
/// Execute the expression on the block with continuation.
|
||||
void execute(Block & block, ExtraBlockPtr & not_processed, size_t & start_action) const;
|
||||
void execute(Block & block, ExtraBlockPtr & not_processed) const;
|
||||
|
||||
bool hasJoinOrArrayJoin() const;
|
||||
|
||||
|
@ -59,7 +59,7 @@ Block InflatingExpressionTransform::readExecute(Chunk & chunk)
|
||||
res = getInputPort().getHeader().cloneWithColumns(chunk.detachColumns());
|
||||
|
||||
if (res)
|
||||
expression->execute(res, not_processed, action_number);
|
||||
expression->execute(res, not_processed);
|
||||
}
|
||||
else if (not_processed->empty()) /// There's not processed data inside expression.
|
||||
{
|
||||
@ -67,12 +67,12 @@ Block InflatingExpressionTransform::readExecute(Chunk & chunk)
|
||||
res = getInputPort().getHeader().cloneWithColumns(chunk.detachColumns());
|
||||
|
||||
not_processed.reset();
|
||||
expression->execute(res, not_processed, action_number);
|
||||
expression->execute(res, not_processed);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = std::move(not_processed->block);
|
||||
expression->execute(res, not_processed, action_number);
|
||||
expression->execute(res, not_processed);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ private:
|
||||
bool initialized = false;
|
||||
|
||||
ExtraBlockPtr not_processed;
|
||||
size_t action_number = 0;
|
||||
|
||||
Block readExecute(Chunk & chunk);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user