File tree Expand file tree Collapse file tree
fe/fe-core/src/main/java/org/apache/doris/qe Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9797import org .apache .doris .thrift .PaloInternalServiceVersion ;
9898import org .apache .doris .thrift .TAIResource ;
9999import org .apache .doris .thrift .TBrokerScanRange ;
100+ import org .apache .doris .thrift .TDataSink ;
100101import org .apache .doris .thrift .TDataSinkType ;
101102import org .apache .doris .thrift .TDescriptorTable ;
102103import org .apache .doris .thrift .TErrorTabletInfo ;
@@ -565,12 +566,19 @@ private static void assignAdaptiveRandomBucketForFragment(
565566 if (partitionAssignments == null ) {
566567 continue ;
567568 }
569+ TOlapTableSink copiedSink = deepCopyOlapTableSinkForCurrentBackend (sinkParam );
568570 OlapTableSink .applyAdaptiveRandomBucketAssignments (
569- sinkParam . getFragment (). getOutputSink (). getOlapTableSink () .getPartition ().getPartitions (),
571+ copiedSink .getPartition ().getPartitions (),
570572 partitionAssignments );
571573 }
572574 }
573575
576+ private static TOlapTableSink deepCopyOlapTableSinkForCurrentBackend (TPipelineFragmentParams sinkParam ) {
577+ TDataSink copiedOutputSink = sinkParam .getFragment ().getOutputSink ().deepCopy ();
578+ sinkParam .getFragment ().setOutputSink (copiedOutputSink );
579+ return copiedOutputSink .getOlapTableSink ();
580+ }
581+
574582 // Initialize
575583 protected void prepare () throws UserException {
576584 for (PlanFragment fragment : fragments ) {
Original file line number Diff line number Diff line change @@ -295,12 +295,19 @@ private static void assignAdaptiveRandomBucketForSinkParams(List<TPipelineFragme
295295 if (partitionAssignments == null ) {
296296 continue ;
297297 }
298+ TOlapTableSink copiedSink = deepCopyOlapTableSinkForCurrentBackend (sinkParam );
298299 OlapTableSink .applyAdaptiveRandomBucketAssignments (
299- sinkParam . getFragment (). getOutputSink (). getOlapTableSink () .getPartition ().getPartitions (),
300+ copiedSink .getPartition ().getPartitions (),
300301 partitionAssignments );
301302 }
302303 }
303304
305+ private static TOlapTableSink deepCopyOlapTableSinkForCurrentBackend (TPipelineFragmentParams sinkParam ) {
306+ TDataSink copiedOutputSink = sinkParam .getFragment ().getOutputSink ().deepCopy ();
307+ sinkParam .getFragment ().setOutputSink (copiedOutputSink );
308+ return copiedOutputSink .getOlapTableSink ();
309+ }
310+
304311 private static Multiset <DistributedPlanWorker > computeInstanceNumPerWorker (
305312 List <PipelineDistributedPlan > distributedPlans ) {
306313 Multiset <DistributedPlanWorker > workerCounter = LinkedHashMultiset .create ();
You can’t perform that action at this time.
0 commit comments