hello-stephen commented on code in PR #71215:
URL: https://github.com/apache/doris/pull/71215#discussion_r4763827422
##########
be/src/exprs/vmatch_predicate.cpp:
##########
@@ -247,8 +251,16 @@ Status VMatchPredicate::execute_column_impl(VExprContext*
context, const Block*
// prepare a column to save result
temp_block.insert({nullptr, _data_type, _expr_name});
- RETURN_IF_ERROR(_function->execute(context->fn_context(_fn_context_index),
temp_block,
- arguments, num_columns_without_result,
temp_block.rows()));
+ // Rows match as the index of their tablet would, inside the segment and
in the scanner alike.
+ // Above the scanner the tablet is unknown, and the rows keep the CLucene
element spacing.
+ auto* fn_context = context->fn_context(_fn_context_index);
+ const bool snii_rows =
+ context->inverted_index_storage_format() ==
InvertedIndexStorageFormatPB::SNII;
Review Comment:
[P2] Carry the tablet format through short-circuit point queries
`PointQueryExecutor::_output_data()` evaluates the output contexts created
by `Reusable::init()`. That initializer receives the tablet schema but never
sets this new format field. On an SNII UNIQUE KEY MOW table with
`store_row_column=true` and `light_schema_change=true`, an English inverted
index on scalar `s STRING`, and row `(id=1, s='hello')`, consider this query
with `enable_match_without_inverted_index=true`:
```sql
SELECT NOT(array(s, 'world') MATCH_PHRASE 'hello world')
FROM t WHERE id = 1;
```
`ExpressionTranslator::visitMatch()` binds the English analyzer through
input slot `s`, so this needs no unsupported ARRAY index. The NOT wrapper also
keeps the MATCH out of direct virtual-column extraction. The source-derived
execution paths are:
```text
normal scan: scanner projection, SNII format -> gap 1 -> NOT(false) = true
short circuit: point-query output, unset format -> gap 0 -> NOT(true) = false
```
At the base both paths used gap 0. Please carry the current request tablet's
format into point-query output evaluation too, accounting for cached prepared
contexts, and add a short-circuit-on/off SQL regression for this computed-array
case.
--
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]