Skip to content

Commit

Permalink
fix logging and fragmenter
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Apr 12, 2024
1 parent 7d5fea1 commit 98b7618
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 173 deletions.
8 changes: 4 additions & 4 deletions src/frontend/src/optimizer/plan_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ impl dyn PlanNode {
}
}

const PLAN_DEPTH_THRESHOLD: usize = 256;
const PLAN_DEPTH_THRESHOLD: usize = 30;
const PLAN_TOO_DEEP_NOTICE: &str = "The plan is too deep. \
Consider rewriting the query to simplify it if you encounter any issues.";
Consider simplifying or splitting the query if you encounter any issues.";

impl dyn PlanNode {
/// Serialize the plan node and its children to a stream plan proto.
Expand All @@ -710,7 +710,7 @@ impl dyn PlanNode {
state: &mut BuildFragmentGraphState,
) -> SchedulerResult<StreamPlanPb> {
recursive::tracker!().recurse(|t| {
if t.depth() > PLAN_DEPTH_THRESHOLD {
if t.depth() == PLAN_DEPTH_THRESHOLD {
notice_to_user(PLAN_TOO_DEEP_NOTICE);
}

Expand Down Expand Up @@ -762,7 +762,7 @@ impl dyn PlanNode {
/// (for testing).
pub fn to_batch_prost_identity(&self, identity: bool) -> SchedulerResult<BatchPlanPb> {
recursive::tracker!().recurse(|t| {
if t.depth() > PLAN_DEPTH_THRESHOLD {
if t.depth() == PLAN_DEPTH_THRESHOLD {
notice_to_user(PLAN_TOO_DEEP_NOTICE);
}

Expand Down
Loading

0 comments on commit 98b7618

Please sign in to comment.