morrySnow commented on code in PR #67822:
URL: https://github.com/apache/doris/pull/67822#discussion_r4004494956
##########
be/src/exprs/function/array/function_array_map.h:
##########
@@ -171,7 +171,8 @@ struct ArrayMapImpl {
res_ptr = assemble_column_array(dst);
return Status::OK();
}
- return Status::RuntimeError("Unexpected columns");
+ return Status::InvalidArgument("Unsupported array element type {}",
+ datas[0].nested_type->get_name());
Review Comment:
Addressed in 77304212ddd by removing all backend changes from this PR. The
final PR diff contains no `be/` files, so it no longer introduces or modifies
this unsupported-column error path; validation is handled in FE analysis.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java:
##########
@@ -781,6 +781,12 @@ public boolean canBeCalculatedInArray() {
return isNumericType() || isBooleanType() || isStringLikeType() ||
isNullType();
}
+ /** Whether this type has a BE column implementation supported by
hash-based array set operations. */
+ public boolean canBeUsedInArraySetOperation() {
+ return isNumericType() || isBooleanType() || isStringLikeType() ||
isVarBinaryType()
Review Comment:
Fixed in 77304212ddd. Removed VARBINARY and TIME from
`canBeUsedInArraySetOperation()` so the FE allowlist matches
`ALL_COLUMNS_SIMPLE`. Added negative regression cases for both families in both
`array_union` and `array_intersect`; the generated-oracle and normal regression
runs pass.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayCompact.java:
##########
@@ -61,10 +61,17 @@ private ArrayCompact(ScalarFunctionParams functionParams) {
*/
@Override
public void checkLegalityBeforeTypeCoercion() {
- DataType argType = ((ArrayType)
getArgument(0).getDataType()).getItemType();
- if (argType.isMapType() || argType.isStructType()) {
+ DataType dataType = getArgument(0).getDataType();
+ if (dataType.isNullType()) {
+ return;
+ }
+ if (!dataType.isArrayType()) {
+ throw new AnalysisException("array_compact requires an ARRAY
argument, but got " + dataType.toSql());
+ }
+ DataType itemType = ((ArrayType) dataType).getItemType();
+ if (itemType.isMapType() || itemType.isStructType()) {
Review Comment:
Fixed in 77304212ddd. `ArrayCompact` now rejects non-comparable
metric/complex element types while preserving comparable nested ARRAY elements.
Added negative coverage for BITMAP, HLL, and QUANTILE_STATE plus a positive
nested-ARRAY case; both regression modes pass.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java:
##########
@@ -781,6 +781,12 @@ public boolean canBeCalculatedInArray() {
return isNumericType() || isBooleanType() || isStringLikeType() ||
isNullType();
}
+ /** Whether this type has a BE column implementation supported by
hash-based array set operations. */
+ public boolean canBeUsedInArraySetOperation() {
Review Comment:
Fixed in 77304212ddd. `ArrayExcept` now applies
`canBeUsedInArraySetOperation()` to each non-null ARRAY argument and reports
unsupported element types during FE analysis. Added a BITMAP negative
regression case; both regression modes pass.
--
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]