Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
baibaichen committed Sep 6, 2024
1 parent e0656b7 commit 1bdebdc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
3 changes: 1 addition & 2 deletions cpp-ch/local-engine/Parser/MergeTreeRelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ DB::QueryPlanPtr MergeTreeRelParser::parseReadRel(

auto read_step = storage->reader.readFromParts(
selected_parts,
/* alter_conversions = */
{},
storage->getMutationsSnapshot({}),
names_and_types_list.getNames(),
storage_snapshot,
*query_info,
Expand Down
20 changes: 17 additions & 3 deletions cpp-ch/local-engine/Storages/MergeTree/SparkStorageMergeTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ class SparkStorageMergeTree : public MergeTreeData
{
friend class MergeSparkMergeTreeTask;

struct CustomMutationsSnapshot : public IMutationsSnapshot
{
CustomMutationsSnapshot() = default;

MutationCommands getAlterMutationCommandsForPart(const MergeTreeData::DataPartPtr & part) const override { return {}; }
std::shared_ptr<MergeTreeData::IMutationsSnapshot> cloneEmpty() const override
{
return std::make_shared<CustomMutationsSnapshot>();
}

NameSet getAllUpdatedColumns() const override { return {}; }
};

public:
static void wrapRangesInDataParts(DB::ReadFromMergeTree & source, const DB::RangesInDataParts & ranges);
static void analysisPartsByRanges(DB::ReadFromMergeTree & source, const DB::RangesInDataParts & ranges_in_data_parts);
Expand Down Expand Up @@ -95,11 +108,12 @@ class SparkStorageMergeTree : public MergeTreeData
void movePartitionToTable(const StoragePtr & dest_table, const ASTPtr & partition, ContextPtr context) override;
bool partIsAssignedToBackgroundOperation(const DataPartPtr & part) const override;
void attachRestoredParts(MutableDataPartsVector && /*parts*/) override { throw std::runtime_error("not implement"); }

public:
MutationsSnapshotPtr getMutationsSnapshot(const IMutationsSnapshot::Params & params) const override
MutationsSnapshotPtr getMutationsSnapshot(const IMutationsSnapshot::Params & /*params*/) const override
{
throw std::runtime_error("not implement");
};
return std::make_shared<CustomMutationsSnapshot>();
};
};

class SparkWriteStorageMergeTree final : public SparkStorageMergeTree
Expand Down

0 comments on commit 1bdebdc

Please sign in to comment.