github-actions[bot] commented on code in PR #70369:
URL: https://github.com/apache/doris/pull/70369#discussion_r4502548727
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/connector/converter/ExprToConnectorExpressionConverter.java:
##########
@@ -301,12 +302,26 @@ private static ConnectorExpression
convertLiteral(LiteralExpr literal) {
return new ConnectorLiteral(ct, ((StringLiteral)
literal).getValue());
} else if (literal instanceof DateLiteral) {
return convertDateLiteral((DateLiteral) literal, ct);
+ } else if (literal instanceof ArrayLiteral) {
+ return new ConnectorLiteral(ct, arrayElements((ArrayLiteral)
literal));
} else {
return new ConnectorLiteral(ct, literal.getStringValue());
}
}
- private static ConnectorExpression convertDateLiteral(DateLiteral dl,
ConnectorType ct) {
+ /**
+ * The element values of an ARRAY literal, each in the shape it would have
as a literal of its own:
+ * {@code null} for a NULL element, a nested list for a nested array.
+ */
+ private static List<Object> arrayElements(ArrayLiteral literal) {
+ List<Object> elements = new ArrayList<>(literal.getChildren().size());
+ for (Expr element : literal.getChildren()) {
+ elements.add(convertLiteral((LiteralExpr) element).getValue());
Review Comment:
[P2] Keep zero-date array parameters on the local evaluation path
With BE `allow_zero_date=true`, a binary prepared DATE parameter encoded
with length 4 and zero year/month/day is supported: `Literal.handleDateLiteral`
creates `DateV2Literal(0,0,0)`, and `FoldConstantRuleOnFE.visitArray` preserves
it in `array(?)`. For a Hive scan with `WHERE array_contains(array(?),
date_col)`, the previous conversion left this generic predicate for BE, whose
date decoder normalizes `0000-00-00` to `0000-01-01`. This recursive call now
reaches `convertDateLiteral` / `LocalDate.of(0,0,0)` and throws during scan
planning, before the connector can decline pushdown. Preserve local evaluation
when an array element cannot be represented in the SPI scalar domain, and cover
binary-bound zero dates; the new date tests use canonical parsed dates only.
--
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]