github-actions[bot] commented on code in PR #70369:
URL: https://github.com/apache/doris/pull/70369#discussion_r4545636874
##########
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));
Review Comment:
[P2] Keep cast ARRAY predicates out of Hudi partition pruning
For a Hudi table in an HMS catalog with a STRING partition `p='[1]'`, this
plan should retain the matching rows:
```
Filter(p = CAST([TRUE] AS STRING))
HudiScan
```
The cast remains after FE folding (BE folding defaults off). During physical
scan planning, `convertPredicate` calls this converter, which strips
`CastExpr`; this branch now produces `List<Boolean>` instead of the previous
text `[1]`. `HudiConnectorMetadata.extractLiteralValue` stringifies it as
`[true]` and excludes the `[1]` partition. Hudi stores the empty pruned paths
and plans zero ranges, so the residual cannot recover the rows; the actual BE
cast renders `[1]`. Refuse this cast predicate before partition pushdown, or
make the scalar partition reader reject ARRAY literals, and cover this case.
##########
fe/fe-connector/fe-connector-spi/src/main/java/org/apache/doris/connector/spi/pushdown/ConnectorLiteral.java:
##########
@@ -29,9 +29,10 @@
/**
* A literal value expression.
*
- * <p>The value is a standard Java type. The engine produces exactly these
eight shapes — see the package
+ * <p>The value is a standard Java type. The engine produces exactly these
nine shapes — see the package
* javadoc (Rule 4) for the full Doris-type-to-Java-class table: {@code null},
{@code Boolean}, {@code Long},
- * {@code Double}, {@code BigDecimal}, {@code String}, {@code LocalDate},
{@code LocalDateTime}.</p>
+ * {@code Double}, {@code BigDecimal}, {@code String}, {@code LocalDate},
{@code LocalDateTime}, and for an
+ * {@code ARRAY} an unmodifiable {@code List} whose elements take these same
shapes.</p>
Review Comment:
[P2] Bump the plugin API for the new ARRAY value shape
Changing the value from String to List breaks already-built connectors while
`connector.plugin.api.version` remains 30.0. `ApiVersionGate` therefore still
admits a JDBC plugin built from the base, and the parent-first SPI supplies it
these new values. That plugin's old `literalToSql` falls through to
`val.toString()`: a previously working remote-Doris predicate `tags = ['a',
'b']` becomes `tags = [a, b]` with unresolved identifiers, instead of the
quoted `'[a, b]'` that Doris casts to the array. The List guard fixes only
rebuilt plugins. Bump the connector API major and its pinned test, or negotiate
the literal shape, so an FE upgrade cannot silently load this incompatible
reader.
--
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]