github-actions[bot] commented on code in PR #66442:
URL: https://github.com/apache/doris/pull/66442#discussion_r3713014247
##########
be/src/exprs/vtopn_pred.h:
##########
@@ -284,6 +272,27 @@ class VTopNPred : public VExpr {
}
private:
+ ColumnPtr _normalize_filter_result(ColumnPtr column) const {
+ const size_t rows = column->size();
+ if (const auto* constant = check_and_get_column<ColumnConst>(*column))
{
+ auto nested =
_normalize_filter_result(constant->get_data_column_ptr());
+ return ColumnConst::create(std::move(nested), rows);
Review Comment:
[P1] Preserve the nullable wrapper for strict block execution
This reconstructs the constant around a non-nullable `ColumnUInt8`, so a
nullable TopN expression now returns `ColumnConst(ColumnUInt8)` while
`execute_type()` remains `Nullable(Boolean)`. `VExpr::execute_column()` permits
that physical relaxation, but `VExprContext::execute(Block*, int*)` immediately
calls `check_type_and_column_match()`, whose `DataTypeNullable::check_column()`
requires a (possibly const-wrapped) `ColumnNullable`. FileScannerV2 reaches
that strict path in `TableReader::_evaluate_constant_filters()` when a TopN
target maps to a partition or missing-column constant after the bound arrives;
the split then fails with a type mismatch instead of being kept or pruned.
Please preserve a zero-null-map nullable wrapper inside the const result (or
otherwise keep the declared and physical types consistent), and cover the
strict block-execution path in the test.
--
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]