Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-toth committed Nov 10, 2024
1 parent cd57de9 commit 5659520
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions datafusion/sql/src/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
schema: &DFSchema,
planner_context: &mut PlannerContext,
) -> Result<Expr> {
// NOTE: This function is called recusively, so each match arm body should be as
// small as possible to avoid stack overflows in debug builds. Follow the
// common pattern of extracting into a separate function for non-trivial
// arms. See https://github.com/apache/datafusion/pull/12384 for more context.
// NOTE: This function is called recursively, so each match arm body should be as
// small as possible to decrease stack requirement.
// Follow the common pattern of extracting into a separate function for
// non-trivial arms. See https://github.com/apache/datafusion/pull/12384 for
// more context.
match sql {
SQLExpr::Value(value) => {
self.parse_value(value, planner_context.prepare_param_data_types())
Expand Down
2 changes: 0 additions & 2 deletions datafusion/sql/src/expr/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
)))
}

// IMPORTANT: Keep sql_array_literal's function body small to prevent stack overflow
// This function is recursively called, potentially leading to deep call stacks.
pub(super) fn sql_array_literal(
&self,
elements: Vec<SQLExpr>,
Expand Down

0 comments on commit 5659520

Please sign in to comment.