github-actions[bot] commented on code in PR #68439:
URL: https://github.com/apache/doris/pull/68439#discussion_r4081676658
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DictGetMany.java:
##########
@@ -68,6 +69,21 @@ public void checkLegalityBeforeTypeCoercion() {
if (!getArgument(0).isLiteral() || !getArgument(1).isLiteral()) {
throw new AnalysisException("dict_get() requires literal arguments
for position 0 and 1");
}
+ if (!(getArgument(1) instanceof ArrayLiteral)) {
+ throw new AnalysisException("dict_get_many() second argument must
be a constant ARRAY<VARCHAR>");
+ }
+ ArrayLiteral valueColumnNames = (ArrayLiteral) getArgument(1);
+ if (!((ArrayType)
valueColumnNames.getDataType()).getItemType().isStringLikeType()
+ ||
valueColumnNames.getValue().stream().anyMatch(valueColumnName ->
Review Comment:
**[P1] Reject typed NULL value-column names**
Parser coercion makes `['value_col', NULL]` an `ArrayLiteral<VARCHAR>` whose
`NullLiteral(VARCHAR)` passes both type checks here. `customSignatureDict()`
then treats that NULL as the metadata string `"null"`, while translation
preserves a real NULL and BE reads every array element as `TYPE_STRING`;
ordinary dictionaries escape through an unrelated `IllegalArgumentException`,
and a quoted value column named `null` reaches an invalid FE/BE representation
mismatch. Please reject NULL elements explicitly (or require non-null string
literals) and add parser/analyzer-level coverage.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]