提交 9b42e934 编写于 作者: N Nikolai Kochetov

Support SAMPLE and FINAL together in MergeTree.

上级 f770934e
......@@ -458,7 +458,12 @@ Pipes MergeTreeDataSelectExecutor::readFromParts(
/// So, assume that we already have calculated column.
ASTPtr sampling_key_ast = data.getSamplingKeyAST();
if (select.final())
std::make_shared<ASTIdentifier>(sampling_key_ast->getColumnName());
{
auto sampling_column_name = sampling_key_ast->getColumnName();
sampling_key_ast = std::make_shared<ASTIdentifier>(sampling_column_name);
/// We do spoil available_real_columns here, but it is not used later.
available_real_columns.emplace_back(std::move(sampling_column_name));
}
if (has_lower_limit)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册