Skip to content

Commit

Permalink
support mergetree on s3 plain
Browse files Browse the repository at this point in the history
  • Loading branch information
liuneng1994 committed Jan 16, 2024
1 parent 234ed86 commit 028d5c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ std::vector<std::string> MetadataStorageFromPlainObjectStorage::listDirectory(co
}

std::unordered_set<std::string> duplicates_filter;
auto prefix = object_storage->generateObjectKeyForPath("example");
for (auto & row : result)
{
chassert(row.starts_with(abs_key));
row.erase(0, abs_key.size());
auto slash_pos = row.find_first_of('/');
if (slash_pos != std::string::npos)
row.erase(slash_pos, row.size() - slash_pos);
chassert(row.starts_with(prefix.getPrefix()));
row.erase(0, prefix.getPrefix().size());
// auto slash_pos = row.find_first_of('/');
// if (slash_pos != std::string::npos)
// row.erase(slash_pos, row.size() - slash_pos);
duplicates_filter.insert(row);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Processors/QueryPlan/ReadFromMergeTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class ReadFromMergeTree final : public SourceStepWithFilter

bool hasAnalyzedResult() const { return analyzed_result_ptr != nullptr; }
void setAnalyzedResult(AnalysisResultPtr analyzed_result_ptr_) { analyzed_result_ptr = std::move(analyzed_result_ptr_); }
ReadFromMergeTree::AnalysisResult getAnalysisResult() const;

const MergeTreeData::DataPartsVector & getParts() const { return prepared_parts; }
const std::vector<AlterConversionsPtr> & getAlterConvertionsForParts() const { return alter_conversions_for_parts; }
Expand Down Expand Up @@ -289,7 +290,6 @@ class ReadFromMergeTree final : public SourceStepWithFilter
Pipe spreadMarkRangesAmongStreamsFinal(
RangesInDataParts && parts, size_t num_streams, const Names & origin_column_names, const Names & column_names, ActionsDAGPtr & out_projection);

ReadFromMergeTree::AnalysisResult getAnalysisResult() const;
AnalysisResultPtr analyzed_result_ptr;

bool is_parallel_reading_from_replicas;
Expand Down

0 comments on commit 028d5c8

Please sign in to comment.