You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "GWphua (via GitHub)" <gi...@apache.org> on 2026/09/23 03:49:43 UTC
Re: [PR] perf(sql): reduce SQL planning allocations for large literal arrays (druid)
GWphua commented on code in PR #20367:
URL: https://github.com/apache/druid/pull/20367#discussion_r4078862230
##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRexExecutor.java:
##########
@@ -246,4 +256,45 @@ private static String getInputValueOrExpression(final RexNode constExp)
}
return constExp.toString();
}
+
+ ///
+ /// Reduces literal string and integer arrays without formatting, parsing, or evaluating a Druid expression.
+ ///
+ /// Reuses the original array call when every literal's type matches the array component type, ignoring nullability.
+ /// These literals already have the required types and values, so rebuilding them would only add allocations.
+ /// Nullability differences do not require conversion: a non-null literal may belong to an array with nullable elements,
+ /// and reusing the call preserves both null values and the original array type.
+ ///
+ /// Returns null for mismatched element types, unsupported types, or non-literal operands (including CAST calls).
+ /// These retain the existing Druid expression evaluation path, including any required type normalization.
+ ///
Review Comment:
/// Seems like a wrong JavaDoc format
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org