fix build

This commit is contained in:
Anton Popov 2021-09-09 14:27:10 +03:00
parent 4c388e3d84
commit ee9f85686b
4 changed files with 34 additions and 8 deletions

View File

@ -297,10 +297,6 @@ public:
Map = 26,
UUID = 27,
Object = 28,
// Special types for index analysis
NegativeInfinity = 254,
PositiveInfinity = 255,
};
static const char * toString(Which which)

View File

@ -4515,7 +4515,37 @@ bool MergeTreeData::getQueryProcessingStageWithAggregateProjection(
}
// Let's select the best projection to execute the query.
if (!candidates.empty() && !selected_candidate)src/Storages/StorageS3.cpp
if (!candidates.empty() && !selected_candidate)
{
std::shared_ptr<PartitionIdToMaxBlock> max_added_blocks;
if (settings.select_sequential_consistency)
{
if (const StorageReplicatedMergeTree * replicated = dynamic_cast<const StorageReplicatedMergeTree *>(this))
max_added_blocks = std::make_shared<PartitionIdToMaxBlock>(replicated->getMaxAddedBlocks());
}
auto parts = getDataPartsVector();
MergeTreeDataSelectExecutor reader(*this);
query_info.merge_tree_select_result_ptr = reader.estimateNumMarksToRead(
parts,
analysis_result.required_columns,
metadata_snapshot,
metadata_snapshot,
query_info,
query_context,
settings.max_threads,
max_added_blocks);
if (!query_info.merge_tree_select_result_ptr->error())
{
// Add 1 to base sum_marks so that we prefer projections even when they have equal number of marks to read.
// NOTE: It is not clear if we need it. E.g. projections do not support skip index for now.
min_sum_marks = query_info.merge_tree_select_result_ptr->marks() + 1;
}
/// Favor aggregate projections
for (auto & candidate : candidates)
{
if (candidate.desc->type == ProjectionDescription::Type::Aggregate)
{
selectBestProjection(

View File

@ -77,7 +77,7 @@ StorageExecutable::StorageExecutable(
Pipe StorageExecutable::read(
const Names & /*column_names*/,
const StorageMetadataPtr & metadata_snapshot,
const StorageSnapshotPtr & storage_snapshot,
SelectQueryInfo & /*query_info*/,
ContextPtr context,
QueryProcessingStage::Enum /*processed_stage*/,
@ -172,7 +172,7 @@ Pipe StorageExecutable::read(
tasks.emplace_back(std::move(task));
}
auto sample_block = metadata_snapshot->getSampleBlock();
auto sample_block = storage_snapshot->metadata->getSampleBlock();
ShellCommandSourceConfiguration configuration;
configuration.max_block_size = max_block_size;

View File

@ -31,7 +31,7 @@ public:
Pipe read(
const Names & column_names,
const StorageMetadataPtr & /*metadata_snapshot*/,
const StorageSnapshotPtr & /*storage_snapshot*/,
SelectQueryInfo & query_info,
ContextPtr context,
QueryProcessingStage::Enum processed_stage,