github-actions[bot] commented on code in PR #69040:
URL: https://github.com/apache/doris/pull/69040#discussion_r4281558360
##########
be/src/exprs/vcondition_expr.cpp:
##########
@@ -673,6 +673,7 @@ Status VectorizedCoalesceExpr::execute_column(VExprContext*
context, const Block
bool cannot_random_write = result_column->is_column_string() ||
result_type->get_primitive_type() ==
PrimitiveType::TYPE_MAP ||
result_type->get_primitive_type() ==
PrimitiveType::TYPE_STRUCT ||
+ result_type->get_primitive_type() ==
PrimitiveType::TYPE_FILE ||
Review Comment:
[P2] Add FILE dispatch to multi-arm CASE expressions
FILE is handled for COALESCE here, but the parallel CASE evaluator still
lacks it. This reduced plan survives CaseWhenToIf, which rewrites only a single
WHEN:
```text
Project(CASE WHEN number=0 THEN f
WHEN number=1 THEN NULL::FILE ELSE g END)
Project(number, <nonconstant FILE cast> AS f,
<different nonconstant FILE cast> AS g)
Numbers
```
With the default short_circuit_evaluation=false,
ExpressionTranslator.visitCaseWhen emits a CaseExpr routed to VCaseExpr;
_execute_impl then calls _execute_update_result, whose type switch has no
TYPE_FILE and throws `argument_type File not supported` (or Nullable(File)).
Thus valid FILE selection fails as soon as a CASE retains multiple WHEN arms.
Add ColumnFile to the CASE dispatch and variable-length copying path, and cover
a multi-arm, mixed-row CASE; the added regression CASE has one WHEN and is
rewritten to IF.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArraySort.java:
##########
@@ -68,7 +68,7 @@ public void checkLegalityBeforeTypeCoercion() {
itemType = ((ArrayType) itemType).getItemType();
}
if (itemType.isMapType() || itemType.isStructType()
- || itemType.isVariantType() || itemType.isJsonType()) {
+ || itemType.isVariantType() || itemType.isJsonType() ||
itemType.typeContainsFile()) {
Review Comment:
[P2] Reject FILE in the other array comparator functions
The new guard covers ARRAY_SORT, but ARRAY_REVERSE_SORT still lacks the FILE
check and ARRAY_COMPACT rejects only MAP/STRUCT; neither uses the updated
ArrayFunctionUtils guard. For a non-NULL FILE `f` produced by a six-field
STRUCT cast over Numbers, this reduced plan passes analysis:
```text
Project(array_reverse_sort(array(f,f)),
array_compact(array(f,f)))
Project(CAST(named_struct('uri',concat('urn:',number),
'offset',NULL,'size',NULL,'content_type',NULL,
'checksum',NULL,'inline',NULL) AS FILE) AS f)
Numbers
```
Both ARRAY<ANY> signatures accept it, then FunctionArraySort::Less /
FunctionArrayCompact::_execute calls ColumnNullable::compare_at ->
ColumnFile::compare_at and fails with `FILE comparison is not supported`. Apply
the recursive FILE restriction to both parallel legality methods and add
non-NULL, two-element negative cases.
--
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]