Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel39 committed Sep 12, 2024
1 parent 86d161e commit 72acdf5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,9 @@ Status PipelineXFragmentContext::_build_pipeline_x_tasks(
}
return Status::OK();
};
if (target_size > 1) {
if (target_size > 1 &&
(_runtime_state->query_options().__isset.parallel_prepare_threshold &&
target_size > _runtime_state->query_options().parallel_prepare_threshold)) {
Status prepare_status[target_size];
std::mutex m;
std::condition_variable cv;
Expand All @@ -730,7 +732,9 @@ Status PipelineXFragmentContext::_build_pipeline_x_tasks(
}
}
} else {
RETURN_IF_ERROR(pre_and_submit(0, this));
for (size_t i = 0; i < target_size; i++) {
RETURN_IF_ERROR(pre_and_submit(i, this));
}
}
_pipeline_parent_map.clear();
_dag.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ public class SessionVariable implements Serializable, Writable {

public static final String AUTO_BROADCAST_JOIN_THRESHOLD = "auto_broadcast_join_threshold";

public static final String PARALLEL_PREPARE_THRESHOLD = "parallel_prepare_threshold";

public static final String ENABLE_PROJECTION = "enable_projection";

public static final String CHECK_OVERFLOW_FOR_DECIMAL = "check_overflow_for_decimal";
Expand Down Expand Up @@ -1038,6 +1040,9 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = AUTO_BROADCAST_JOIN_THRESHOLD)
public double autoBroadcastJoinThreshold = 0.8;

@VariableMgr.VarAttr(name = PARALLEL_PREPARE_THRESHOLD)
public int parallelPrepareThreshold = 32;

@VariableMgr.VarAttr(name = ENABLE_COST_BASED_JOIN_REORDER)
private boolean enableJoinReorderBasedCost = false;

Expand Down Expand Up @@ -3403,6 +3408,7 @@ public TQueryOptions toThrift() {
tResult.setNumScannerThreads(numScannerThreads);
tResult.setScannerScaleUpRatio(scannerScaleUpRatio);
tResult.setMaxColumnReaderNum(maxColumnReaderNum);
tResult.setParallelPrepareThreshold(parallelPrepareThreshold);

// TODO chenhao, reservation will be calculated by cost
tResult.setMinReservation(0);
Expand Down
2 changes: 2 additions & 0 deletions gensrc/thrift/PaloInternalService.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ struct TQueryOptions {
128: optional bool enable_verbose_profile = false;
129: optional i32 rpc_verbose_profile_max_instance_count = 0;

// only in 2.1
999: optional i32 parallel_prepare_threshold = 0;
// For cloud, to control if the content would be written into file cache
1000: optional bool disable_file_cache = false
}
Expand Down

0 comments on commit 72acdf5

Please sign in to comment.