Skip to content

Commit 3b279bd

Browse files
committed
some vibe coded fix - too tired, continue tomorrow
1 parent 66729a7 commit 3b279bd

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/Interpreters/Context.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3136,6 +3136,13 @@ void Context::makeQueryContextForMutate(const MergeTreeSettings & merge_tree_set
31363136
= merge_tree_settings[MergeTreeSetting::mutation_workload].value.empty() ? getMutationWorkload() : merge_tree_settings[MergeTreeSetting::mutation_workload];
31373137
}
31383138

3139+
void Context::makeQueryContextForExportPart()
3140+
{
3141+
makeQueryContext();
3142+
classifier.reset(); // It is assumed that there are no active queries running using this classifier, otherwise this will lead to crashes
3143+
// Export part operations don't have a specific workload setting, so we leave the default workload
3144+
}
3145+
31393146
void Context::makeSessionContext()
31403147
{
31413148
session_context = shared_from_this();

src/Interpreters/Context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ class Context: public ContextData, public std::enable_shared_from_this<Context>
11351135
void makeQueryContext();
11361136
void makeQueryContextForMerge(const MergeTreeSettings & merge_tree_settings);
11371137
void makeQueryContextForMutate(const MergeTreeSettings & merge_tree_settings);
1138+
void makeQueryContextForExportPart();
11381139
void makeSessionContext();
11391140
void makeGlobalContext();
11401141

src/Storages/MergeTree/ExportPartitionTaskScheduler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ namespace
2222
ContextPtr getContextCopyWithTaskSettings(const ContextPtr & context, const ExportReplicatedMergeTreePartitionManifest & manifest)
2323
{
2424
auto context_copy = Context::createCopy(context);
25+
context_copy->makeQueryContextForExportPart();
26+
context_copy->setCurrentQueryId(manifest.transaction_id);
2527
context_copy->setSetting("output_format_parallel_formatting", manifest.parallel_formatting);
2628
context_copy->setSetting("output_format_parquet_parallel_encoding", manifest.parquet_parallel_encoding);
2729
context_copy->setSetting("max_threads", manifest.max_threads);

0 commit comments

Comments
 (0)