Fix tests

This commit is contained in:
Amos Bird 2021-05-04 00:41:48 +08:00
parent 42f161b1dc
commit a3fd0b6f2e
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
8 changed files with 17 additions and 17 deletions

View File

@ -168,8 +168,8 @@ public:
void removeUnusedActions(const Names & required_names);
void removeUnusedActions(const NameSet & required_names);
NameSet
foldActionsByProjection(const NameSet & keys, const Block & projection_block_for_keys, const String & predicate_column_name = {});
NameSet foldActionsByProjection(
const NameSet & required_columns, const Block & projection_block_for_keys, const String & predicate_column_name = {});
void reorderAggregationKeysForProjection(const std::unordered_map<std::string_view, size_t> & key_names_pos_map);
void addAggregatesViaProjection(const Block & aggregates);

View File

@ -20,6 +20,6 @@ TEST(QueryNormalizer, SimpleCycleAlias)
aliases["b"] = parseQuery(parser, "a as b", 0, 0)->children[0];
Settings settings;
QueryNormalizer::Data normalizer_data(aliases, {}, settings);
QueryNormalizer::Data normalizer_data(aliases, {}, false, settings);
EXPECT_THROW(QueryNormalizer(normalizer_data).visit(ast), Exception);
}

View File

@ -637,7 +637,7 @@ void Fetcher::downloadBaseOrProjectionPartToDisk(
bool sync,
DiskPtr disk,
PooledReadWriteBufferFromHTTP & in,
MergeTreeData::DataPart::Checksums & checksums)
MergeTreeData::DataPart::Checksums & checksums) const
{
size_t files;
readBinary(files, in);

View File

@ -89,7 +89,7 @@ private:
bool sync,
DiskPtr disk,
PooledReadWriteBufferFromHTTP & in,
MergeTreeData::DataPart::Checksums & checksums);
MergeTreeData::DataPart::Checksums & checksums) const;
MergeTreeData::MutableDataPartPtr downloadPartToDisk(
const String & part_name,

View File

@ -3936,7 +3936,7 @@ bool MergeTreeData::getQueryProcessingStageWithAggregateProjection(
if (analysis_result.prewhere_info)
{
auto & prewhere_info = analysis_result.prewhere_info;
const auto & prewhere_info = analysis_result.prewhere_info;
candidate.prewhere_info = std::make_shared<PrewhereInfo>();
candidate.prewhere_info->prewhere_column_name = prewhere_info->prewhere_column_name;
candidate.prewhere_info->remove_prewhere_column = prewhere_info->remove_prewhere_column;

View File

@ -2205,7 +2205,7 @@ void MergeTreeDataSelectExecutor::selectPartsToRead(
std::swap(prev_parts, parts);
for (const auto & part_or_projection : prev_parts)
{
const auto part = part_or_projection->isProjectionPart() ? part_or_projection->getParentPart() : part_or_projection.get();
const auto * part = part_or_projection->isProjectionPart() ? part_or_projection->getParentPart() : part_or_projection.get();
if (!part_values.empty() && part_values.find(part->name) == part_values.end())
continue;
@ -2267,7 +2267,7 @@ void MergeTreeDataSelectExecutor::selectPartsToReadWithUUIDFilter(
std::swap(prev_parts, selected_parts);
for (const auto & part_or_projection : prev_parts)
{
const auto part = part_or_projection->isProjectionPart() ? part_or_projection->getParentPart() : part_or_projection.get();
const auto * part = part_or_projection->isProjectionPart() ? part_or_projection->getParentPart() : part_or_projection.get();
if (!part_values.empty() && part_values.find(part->name) == part_values.end())
continue;

View File

@ -44,13 +44,13 @@ optimize_move_to_prewhere = 1, allow_experimental_projection_optimization = 1
8 4294967287
9 4294967286
optimize_move_to_prewhere = 0, allow_experimental_projection_optimization = 0
"rows_read": 8192,
"rows_read": 100,
optimize_move_to_prewhere = 0, allow_experimental_projection_optimization = 1
"rows_read": 8192,
"rows_read": 100,
optimize_move_to_prewhere = 1, allow_experimental_projection_optimization = 0
"rows_read": 8192,
"rows_read": 100,
optimize_move_to_prewhere = 1, allow_experimental_projection_optimization = 1
"rows_read": 8192,
"rows_read": 100,
select where y > 4294967286
optimize_move_to_prewhere = 0, allow_experimental_projection_optimization = 0
0 4294967295
@ -93,10 +93,10 @@ optimize_move_to_prewhere = 1, allow_experimental_projection_optimization = 1
7 4294967288
8 4294967287
optimize_move_to_prewhere = 0, allow_experimental_projection_optimization = 0
"rows_read": 1000000,
"rows_read": 100,
optimize_move_to_prewhere = 0, allow_experimental_projection_optimization = 1
"rows_read": 8768,
"rows_read": 100,
optimize_move_to_prewhere = 1, allow_experimental_projection_optimization = 0
"rows_read": 1000000,
"rows_read": 100,
optimize_move_to_prewhere = 1, allow_experimental_projection_optimization = 1
"rows_read": 8768,
"rows_read": 100,

View File

@ -5,7 +5,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_CLIENT -q "CREATE TABLE test_sort_proj (x UInt32, y UInt32, PROJECTION p (SELECT x, y ORDER BY y) TYPE normal) ENGINE = MergeTree ORDER BY x"
$CLICKHOUSE_CLIENT -q "insert into test_sort_proj select number, toUInt32(-number - 1) from numbers(1000000)"
$CLICKHOUSE_CLIENT -q "insert into test_sort_proj select number, toUInt32(-number - 1) from numbers(100)"
echo "select where x < 10"