Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
2ee716e
temp commit
arthurpassos Jul 3, 2022
c913dcf
temp commit
arthurpassos Jul 15, 2022
d633bd1
draft impl for feedback
arthurpassos Jul 22, 2022
a2e9082
Merge branch 'ClickHouse:master' into allow_attach_more_granular_part…
arthurpassos Jul 22, 2022
b38045d
fix weird style changes
arthurpassos Jul 22, 2022
456313b
fix weird style changes
arthurpassos Jul 22, 2022
f61eab2
fix weird style changes
arthurpassos Jul 22, 2022
7946494
fix weird style changes
arthurpassos Jul 22, 2022
70d5b41
fix weird style changes
arthurpassos Jul 22, 2022
b850783
aa
arthurpassos Jul 22, 2022
68af6d4
aa
arthurpassos Jul 22, 2022
c7d91d8
Add integ tests and remove partition key restriction
arthurpassos Jul 25, 2022
a5bc31b
fix small incosistency in partition id
arthurpassos Jul 26, 2022
ca8f940
style fix
arthurpassos Jul 26, 2022
17b393c
style fix
arthurpassos Jul 26, 2022
98c732e
style fix
arthurpassos Jul 26, 2022
4855dd3
use existing DataPartStorageBuilder instead of new one
arthurpassos Jul 26, 2022
8f34190
Refactor part clone to make it more readable and maintainable
arthurpassos Jul 27, 2022
afca632
Add MergeTreeDataPartCloner docs
arthurpassos Jul 28, 2022
b27375e
define ErrorCodes::BAD_ARGUMENTS
arthurpassos Jul 29, 2022
34348a6
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Sep 7, 2022
e739670
Rebase
arthurpassos Sep 7, 2022
fdc0f68
camel case methods
arthurpassos Sep 7, 2022
3325bf6
address some comments
arthurpassos Oct 1, 2022
25ab01b
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Oct 1, 2022
cc48924
yet another rebase?
arthurpassos Oct 3, 2022
edf8e7d
Move from integ tests to stateless tests
arthurpassos Oct 3, 2022
eb74497
address more comments
arthurpassos Oct 3, 2022
3a338e2
add finalize on min_max_idx files
arthurpassos Oct 3, 2022
2e42ce4
Add sync option to DistinctPartitionExpCloner
arthurpassos Oct 4, 2022
62ec90d
just a temp test
arthurpassos Oct 4, 2022
22ccdd2
revert temp change
arthurpassos Oct 5, 2022
85724a1
Use echoOn to distinguish test queries
arthurpassos Oct 5, 2022
c9159fb
remove comment
arthurpassos Oct 6, 2022
da94a54
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Oct 25, 2022
d7449fc
fix build issue during rebase
arthurpassos Oct 27, 2022
10f31c8
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Oct 27, 2022
a24e85c
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Oct 28, 2022
034bcec
atempt to fix build after rebase
arthurpassos Oct 28, 2022
a6fa4b1
finally fix build
arthurpassos Oct 28, 2022
8ff4276
Merge branch 'master' into allow_attach_more_granular_partition
alexey-milovidov Nov 21, 2022
e89100d
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Nov 25, 2022
8dfcbec
clear minmaxidx hyperrectangle before loading it
arthurpassos Nov 30, 2022
c2a26ee
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Nov 30, 2022
742f371
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Dec 7, 2022
edb5e1d
Fix error on min_max files deletion where it was being assumed that p…
arthurpassos Dec 8, 2022
8357782
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Apr 10, 2023
38240a9
get it to the state it was previously
arthurpassos Apr 10, 2023
f7cc616
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Apr 13, 2023
f1df6d6
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Apr 24, 2023
5eb8671
add missing include
arthurpassos Apr 13, 2023
350fab3
getting functional?
arthurpassos May 8, 2023
5d7e629
refactoring and renaming
arthurpassos May 8, 2023
0f9b578
some more refactoring
arthurpassos May 8, 2023
154969b
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos May 8, 2023
1c56872
extern bad arguments
arthurpassos May 8, 2023
6f248b2
try to fix style
arthurpassos May 8, 2023
2ef6aeb
improvements and docs
arthurpassos May 9, 2023
2237fa5
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos May 9, 2023
690f00d
remove duplicate includes
arthurpassos May 9, 2023
c96e6f8
fix crash
arthurpassos May 10, 2023
e0112c9
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos May 10, 2023
86866d3
make tests more stable by ordering
arthurpassos May 11, 2023
843043f
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Jun 29, 2023
52dfc71
rebase once again..
arthurpassos Jun 29, 2023
925d431
fix
arthurpassos Jun 29, 2023
78b75bb
Merge branch 'master' into allow_attach_more_granular_partition
alexey-milovidov Jun 30, 2023
ef6c716
make ci happy?
arthurpassos Jun 30, 2023
8582e7b
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Aug 14, 2023
ce9fddc
fix rebase issues
arthurpassos Aug 14, 2023
d3656d4
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Aug 17, 2023
4bb7f17
docs
arthurpassos Aug 21, 2023
1ff45ba
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Oct 31, 2023
4dcd28f
rebase, but prolly needs to be improved
arthurpassos Oct 31, 2023
e9ba192
refactor out from nasty inheritance to static methods
arthurpassos Nov 1, 2023
15a8376
fix style
arthurpassos Nov 1, 2023
23df591
work around optional
arthurpassos Nov 1, 2023
6ebfc00
refactor & integrate some changes
arthurpassos Nov 1, 2023
6ca0e21
update column_type
arthurpassos Nov 2, 2023
920fcf4
add tests by dencrane
arthurpassos Nov 2, 2023
124b434
set utc
arthurpassos Nov 3, 2023
2f7315b
fix ref file
arthurpassos Nov 3, 2023
48e9b1b
fix tests
arthurpassos Nov 3, 2023
e2ca5ae
use MergeTree instead of SummingMergeTree
arthurpassos Nov 6, 2023
91a83c7
Merge branch 'ClickHouse:master' into allow_attach_more_granular_part…
arthurpassos Nov 9, 2023
116af6e
mark MergeTreeDataPart::getBlock as const
arthurpassos Nov 10, 2023
276694b
address a few comments
arthurpassos Nov 15, 2023
395ef94
compute module function name size at compile time
arthurpassos Nov 15, 2023
6e5cb74
simplify branching in getPartitionAstFieldsCount
arthurpassos Nov 16, 2023
8355db2
remove column_indexes argument
arthurpassos Nov 16, 2023
f9c8633
merge getBlock with buildBlock
arthurpassos Nov 16, 2023
d683045
add some const specifiers
arthurpassos Nov 16, 2023
6091213
small adjustments
arthurpassos Nov 17, 2023
129db26
remove no longer needed isNull check
arthurpassos Nov 17, 2023
b2fe79d
use std::min and max to update global min max idx
arthurpassos Nov 17, 2023
8188c8c
add some assertions
arthurpassos Nov 17, 2023
3784730
forward declare some symbols
arthurpassos Nov 17, 2023
c190882
fix grammar
arthurpassos Nov 17, 2023
0326f39
forward decl
arthurpassos Nov 17, 2023
ad4cb04
try to fix build..
arthurpassos Nov 17, 2023
8037cf0
remove IFunction forward decl
arthurpassos Nov 17, 2023
20246d4
Revert "use std::min and max to update global min max idx"
arthurpassos Nov 18, 2023
9416087
Revert "remove no longer needed isNull check"
arthurpassos Nov 18, 2023
7a76cf7
Revert "Revert "remove no longer needed isNull check""
arthurpassos Nov 18, 2023
16c3948
Revert "Revert "use std::min and max to update global min max idx""
arthurpassos Nov 18, 2023
441c99c
Merge branch 'ClickHouse:master' into allow_attach_more_granular_part…
arthurpassos Nov 21, 2023
352b4ca
remove some comments
arthurpassos Nov 21, 2023
8401568
partial use of MonotonicityCheckMatcher
arthurpassos Nov 22, 2023
b845b03
ranges
arthurpassos Nov 22, 2023
5d5b70c
remove KeyDescriptionMonotonicityChecker
arthurpassos Nov 22, 2023
e11bb59
remove duplication of applyfunction
arthurpassos Nov 22, 2023
54ae855
move functions to anonymous namespace
arthurpassos Nov 22, 2023
80a8d7b
move functions to cpp
arthurpassos Nov 23, 2023
a402a04
Relax partition compatibility requirements by accepting subset, add t…
arthurpassos Nov 24, 2023
776ce93
updte reference file
arthurpassos Nov 24, 2023
0621d4d
Support for partition by a, b, c to partition by a, b
arthurpassos Nov 28, 2023
7e0aa19
refactoring part 1
arthurpassos Nov 28, 2023
b807d02
refactoring part 2, use hyperrectangle, still not complete
arthurpassos Nov 28, 2023
6a9b81c
refactoring part 3, build hyperrectangle with intersection of source …
arthurpassos Nov 29, 2023
9366d6e
Support attaching to table with partition expression of multiple expr…
arthurpassos Nov 29, 2023
e61d564
add tests
arthurpassos Nov 29, 2023
151ac94
rename method
arthurpassos Nov 29, 2023
28598c2
remove some code duplication
arthurpassos Nov 29, 2023
0830008
draft impl for replicatedmergetree, need to dive deeper
arthurpassos Nov 30, 2023
cf22dac
ship ref file
arthurpassos Nov 30, 2023
0eca23c
fix impl for replicatedmergetree..
arthurpassos Nov 30, 2023
f5c739d
forbid attach empty partition replicatedmergetree
arthurpassos Dec 1, 2023
92afe9e
Add replicated merge tree integration tests
arthurpassos Dec 1, 2023
b16573a
add test missing files
arthurpassos Dec 1, 2023
cbd29de
fix black
arthurpassos Dec 1, 2023
07cc30d
do not check for monotonicity of empty partition
arthurpassos Dec 1, 2023
2427cf9
add empty tests & fix replicated
arthurpassos Dec 4, 2023
f393663
remove no longer needed buildBlockWithMinMaxINdexes
arthurpassos Dec 4, 2023
de0bf3d
remove column logic in buildHyperrectangle
arthurpassos Dec 4, 2023
d5b012f
simplify implementation by using existing methods
arthurpassos Dec 4, 2023
3798e5d
further simplify implementation
arthurpassos Dec 4, 2023
6410828
move all MergeTreeDataPartClone private methods to .cpp file
arthurpassos Dec 4, 2023
6c24a1b
decrease decomposition
arthurpassos Dec 4, 2023
be8158b
use different namespaces
arthurpassos Dec 4, 2023
077e290
reduce code duplication
arthurpassos Dec 4, 2023
796b40a
fix style
arthurpassos Dec 4, 2023
bd00b10
address a few comments
arthurpassos Dec 20, 2023
2dc4f45
add chassert to assert arguments size on MonotonicityCheckVisitor
arthurpassos Dec 21, 2023
61fe4d9
remove deleteMinMaxFiles method
arthurpassos Dec 21, 2023
eab15dc
remove useless checks from sanitycheck
arthurpassos Jan 2, 2024
826a3c4
add tests for attach partition (not id)
arthurpassos Jan 2, 2024
e3194e0
Remove sanityCheckASTPartition and bring back conditional getPartitio…
arthurpassos Jan 3, 2024
074c47e
remove empty block comment
arthurpassos Jan 3, 2024
18c9521
small fixes
arthurpassos Jan 9, 2024
5e33da3
fix formatting
arthurpassos Jan 9, 2024
5c72acb
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Jan 9, 2024
766fe33
add missing include
arthurpassos Jan 9, 2024
f47c25b
remove duplicate iuncludes
arthurpassos Jan 9, 2024
ac53355
trigger ci
arthurpassos Jan 9, 2024
bebb1f4
reduce some code duplication
arthurpassos Jan 15, 2024
9054222
use updated partition id on replicatedmergetree
arthurpassos Jan 16, 2024
fe24e89
fix build
arthurpassos Jan 16, 2024
6675818
fix build
arthurpassos Jan 16, 2024
6ea844d
small refactor
arthurpassos Jan 16, 2024
9aa84bc
do not use insert increment on fetch part
arthurpassos Jan 18, 2024
f023a67
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Jan 18, 2024
b73e246
remove duplicate includes
arthurpassos Jan 18, 2024
13d3f52
add one more integ test
arthurpassos Jan 18, 2024
9ccde30
black
arthurpassos Jan 18, 2024
bdcc0fd
black
arthurpassos Jan 18, 2024
606ab61
rely on partition exp instead of partition id on replicated part fetc…
arthurpassos Jan 19, 2024
938551b
add one more integ test
arthurpassos Jan 19, 2024
9fba9a8
add order by clause
arthurpassos Jan 19, 2024
d585f2a
fix black
arthurpassos Jan 19, 2024
fe1e326
Merge branch 'master' into allow_attach_more_granular_partition
arthurpassos Jan 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/sql-reference/statements/alter/partition.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Note that:
For the query to run successfully, the following conditions must be met:

- Both tables must have the same structure.
- Both tables must have the same partition key, the same order by key and the same primary key.
- Both tables must have the same order by key and the same primary key.
- Both tables must have the same indices and projections.
- Both tables must have the same storage policy.

Expand Down
102 changes: 92 additions & 10 deletions src/Interpreters/MonotonicityCheckVisitor.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#pragma once

#include <AggregateFunctions/AggregateFunctionFactory.h>
#include <Core/Range.h>
#include <DataTypes/DataTypeFactory.h>
#include <DataTypes/FieldToDataType.h>
#include <Functions/FunctionFactory.h>
#include <IO/WriteHelpers.h>
#include <Interpreters/InDepthNodeVisitor.h>
#include <Interpreters/IdentifierSemantic.h>
#include <Interpreters/InDepthNodeVisitor.h>
#include <Interpreters/applyFunction.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTLiteral.h>
#include <Parsers/ASTOrderByElement.h>
#include <Parsers/ASTTablesInSelectQuery.h>
#include <Parsers/IAST.h>
Expand All @@ -33,6 +37,8 @@ class MonotonicityCheckMatcher
ASTIdentifier * identifier = nullptr;
DataTypePtr arg_data_type = {};

Range range = Range::createWholeUniverse();

void reject() { monotonicity.is_monotonic = false; }
bool isRejected() const { return !monotonicity.is_monotonic; }

Expand Down Expand Up @@ -97,13 +103,30 @@ class MonotonicityCheckMatcher
if (data.isRejected())
return;

/// TODO: monotonicity for functions of several arguments
if (!ast_function.arguments || ast_function.arguments->children.size() != 1)
/// Monotonicity check only works for functions that contain at most two arguments and one of them must be a constant.
if (!ast_function.arguments)
{
data.reject();
return;
}

auto arguments_size = ast_function.arguments->children.size();

if (arguments_size == 0 || arguments_size > 2)
{
data.reject();
return;
}
else if (arguments_size == 2)
{
/// If the function has two arguments, then one of them must be a constant.
if (!ast_function.arguments->children[0]->as<ASTLiteral>() && !ast_function.arguments->children[1]->as<ASTLiteral>())
{
data.reject();
return;
}
}

if (!data.canOptimize(ast_function))
{
data.reject();
Expand All @@ -124,14 +147,33 @@ class MonotonicityCheckMatcher
return;
}

ColumnsWithTypeAndName args;
args.emplace_back(data.arg_data_type, "tmp");
auto function_base = function->build(args);
auto function_arguments = getFunctionArguments(ast_function, data);

auto function_base = function->build(function_arguments);

if (function_base && function_base->hasInformationAboutMonotonicity())
{
bool is_positive = data.monotonicity.is_positive;
data.monotonicity = function_base->getMonotonicityForRange(*data.arg_data_type, Field(), Field());
data.monotonicity = function_base->getMonotonicityForRange(*data.arg_data_type, data.range.left, data.range.right);

auto & key_range = data.range;

/// If we apply function to open interval, we can get empty intervals in result.
/// E.g. for ('2020-01-03', '2020-01-20') after applying 'toYYYYMM' we will get ('202001', '202001').
/// To avoid this we make range left and right included.
/// Any function that treats NULL specially is not monotonic.
/// Thus we can safely use isNull() as an -Inf/+Inf indicator here.
if (!key_range.left.isNull())
{
key_range.left = applyFunction(function_base, data.arg_data_type, key_range.left);
key_range.left_included = true;
}

if (!key_range.right.isNull())
{
key_range.right = applyFunction(function_base, data.arg_data_type, key_range.right);
key_range.right_included = true;
}

if (!is_positive)
data.monotonicity.is_positive = !data.monotonicity.is_positive;
Expand All @@ -143,13 +185,53 @@ class MonotonicityCheckMatcher

static bool needChildVisit(const ASTPtr & parent, const ASTPtr &)
{
/// Currently we check monotonicity only for single-argument functions.
/// Although, multi-argument functions with all but one constant arguments can also be monotonic.
/// Multi-argument functions with all but one constant arguments can be monotonic.
if (const auto * func = typeid_cast<const ASTFunction *>(parent.get()))
return func->arguments->children.size() < 2;
return func->arguments->children.size() <= 2;

return true;
}

static ColumnWithTypeAndName extractLiteralColumnAndTypeFromAstLiteral(const ASTLiteral * literal)
{
ColumnWithTypeAndName result;

result.type = applyVisitor(FieldToDataType(), literal->value);
result.column = result.type->createColumnConst(0, literal->value);

return result;
}

static ColumnsWithTypeAndName getFunctionArguments(const ASTFunction & ast_function, const Data & data)
{
ColumnsWithTypeAndName args;

auto arguments_size = ast_function.arguments->children.size();

chassert(arguments_size == 1 || arguments_size == 2);

if (arguments_size == 2)
{
if (ast_function.arguments->children[0]->as<ASTLiteral>())
{
const auto * literal = ast_function.arguments->children[0]->as<ASTLiteral>();
args.push_back(extractLiteralColumnAndTypeFromAstLiteral(literal));
args.emplace_back(data.arg_data_type, "tmp");
}
else
{
const auto * literal = ast_function.arguments->children[1]->as<ASTLiteral>();
args.emplace_back(data.arg_data_type, "tmp");
args.push_back(extractLiteralColumnAndTypeFromAstLiteral(literal));
}
}
else
{
args.emplace_back(data.arg_data_type, "tmp");
}

return args;
}
};

using MonotonicityCheckVisitor = ConstInDepthNodeVisitor<MonotonicityCheckMatcher, false>;
Expand Down
43 changes: 43 additions & 0 deletions src/Interpreters/applyFunction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <Interpreters/applyFunction.h>

#include <Core/Range.h>
#include <Functions/IFunction.h>

namespace DB
{

static Field applyFunctionForField(const FunctionBasePtr & func, const DataTypePtr & arg_type, const Field & arg_value)
{
ColumnsWithTypeAndName columns{
{arg_type->createColumnConst(1, arg_value), arg_type, "x"},
};

auto col = func->execute(columns, func->getResultType(), 1);
return (*col)[0];
}

FieldRef applyFunction(const FunctionBasePtr & func, const DataTypePtr & current_type, const FieldRef & field)
{
/// Fallback for fields without block reference.
if (field.isExplicit())
return applyFunctionForField(func, current_type, field);

String result_name = "_" + func->getName() + "_" + toString(field.column_idx);
const auto & columns = field.columns;
size_t result_idx = columns->size();

for (size_t i = 0; i < result_idx; ++i)
if ((*columns)[i].name == result_name)
result_idx = i;

if (result_idx == columns->size())
{
ColumnsWithTypeAndName args{(*columns)[field.column_idx]};
field.columns->emplace_back(ColumnWithTypeAndName{nullptr, func->getResultType(), result_name});
(*columns)[result_idx].column = func->execute(args, (*columns)[result_idx].type, columns->front().column->size());
}

return {field.columns, field.row_idx, result_idx};
}

}
16 changes: 16 additions & 0 deletions src/Interpreters/applyFunction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include <memory>

namespace DB
{
struct FieldRef;

class IFunctionBase;
class IDataType;

using DataTypePtr = std::shared_ptr<const IDataType>;
using FunctionBasePtr = std::shared_ptr<const IFunctionBase>;

FieldRef applyFunction(const FunctionBasePtr & func, const DataTypePtr & current_type, const FieldRef & field);
}
5 changes: 5 additions & 0 deletions src/Parsers/queryToString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

namespace DB
{
String queryToStringNullable(const ASTPtr & query)
{
return query ? queryToString(query) : "";
}

String queryToString(const ASTPtr & query)
{
return queryToString(*query);
Expand Down
1 change: 1 addition & 0 deletions src/Parsers/queryToString.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ namespace DB
{
String queryToString(const ASTPtr & query);
String queryToString(const IAST & query);
String queryToStringNullable(const ASTPtr & query);
}
37 changes: 35 additions & 2 deletions src/Storages/MergeTree/IMergeTreeDataPart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void IMergeTreeDataPart::MinMaxIndex::load(const MergeTreeData & data, const Par
auto minmax_column_types = data.getMinMaxColumnsTypes(partition_key);
size_t minmax_idx_size = minmax_column_types.size();

hyperrectangle.clear();
hyperrectangle.reserve(minmax_idx_size);
for (size_t i = 0; i < minmax_idx_size; ++i)
{
Expand All @@ -104,6 +105,39 @@ void IMergeTreeDataPart::MinMaxIndex::load(const MergeTreeData & data, const Par
initialized = true;
}

Block IMergeTreeDataPart::MinMaxIndex::getBlock(const MergeTreeData & data) const
{
if (!initialized)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Attempt to get block from uninitialized MinMax index.");

Block block;

const auto metadata_snapshot = data.getInMemoryMetadataPtr();
const auto & partition_key = metadata_snapshot->getPartitionKey();

const auto minmax_column_names = data.getMinMaxColumnsNames(partition_key);
const auto minmax_column_types = data.getMinMaxColumnsTypes(partition_key);
const auto minmax_idx_size = minmax_column_types.size();

for (size_t i = 0; i < minmax_idx_size; ++i)
{
const auto & data_type = minmax_column_types[i];
const auto & column_name = minmax_column_names[i];

const auto column = data_type->createColumn();

const auto min_val = hyperrectangle.at(i).left;
const auto max_val = hyperrectangle.at(i).right;

column->insert(min_val);
column->insert(max_val);

block.insert(ColumnWithTypeAndName(column->getPtr(), data_type, column_name));
}

return block;
}

IMergeTreeDataPart::MinMaxIndex::WrittenFiles IMergeTreeDataPart::MinMaxIndex::store(
const MergeTreeData & data, IDataPartStorage & part_storage, Checksums & out_checksums) const
{
Expand Down Expand Up @@ -185,8 +219,7 @@ void IMergeTreeDataPart::MinMaxIndex::merge(const MinMaxIndex & other)

if (!initialized)
{
hyperrectangle = other.hyperrectangle;
initialized = true;
*this = other;
}
else
{
Expand Down
1 change: 1 addition & 0 deletions src/Storages/MergeTree/IMergeTreeDataPart.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ class IMergeTreeDataPart : public std::enable_shared_from_this<IMergeTreeDataPar
}

void load(const MergeTreeData & data, const PartMetadataManagerPtr & manager);
Block getBlock(const MergeTreeData & data) const;

using WrittenFiles = std::vector<std::unique_ptr<WriteBufferFromFileBase>>;

Expand Down
Loading