hello-stephen commented on code in PR #71231:
URL: https://github.com/apache/doris/pull/71231#discussion_r4756394265
##########
be/src/exec/common/variant_util.cpp:
##########
@@ -1538,8 +1548,8 @@ bool generate_sub_column_info(const TabletSchema& schema,
int32_t col_unique_id,
break;
}
case PatternTypePB::MATCH_NAME_GLOB: {
- int result = fnmatch(pattern, path.c_str(), FNM_PATHNAME);
- if (result == 0) {
+ if (matches_variant_literal_prefix(*sub_column, path) ||
Review Comment:
[P2] Keep FE template matching consistent with slash prefixes
For a fresh `v VARIANT<'p*':TEXT,'p/x':TEXT>` with an english index for `p*`
and a unicode index for `p/x`, inserting `{"p/x":"hit"}` now writes the first
template's english index. `OlapTable.getInvertedIndexByStoragePath` still uses
slash-sensitive Java globs, so it skips `p*` and sends the unicode index
properties for `SEARCH('v.p/x:hit')`. `FieldReaderResolver` then requests that
analyzer and fails with `No inverted index found for analyzer`; SEARCH cannot
fall back to row execution. Before this change both sides selected `p/x`.
Please apply the same prefix rule in FE and cover overlapping templates with
different analyzers.
##########
be/src/exprs/function/search/search_predicate_collector.cpp:
##########
@@ -83,13 +83,19 @@ Result<ScoringIndexCandidates>
resolve_search_scoring_index_candidates(
field_name, field_binding->parent_field_name));
}
+ // Extracted columns use a lowercase SQL parent and case-sensitive JSON
path.
+ const auto storage_name = parent_column.name_lower_case() + "." +
field_binding->subcolumn_path;
+ const int32_t storage_index = tablet_schema->field_index(storage_name);
Review Comment:
[P2] Verify the Variant parent before accepting a canonical-name hit
With `mixedRoot VARIANT<'key':TEXT>`, an english `field_pattern=key` index
and an ordinary quoted `mixedroot.key INT` column, this new name lookup returns
the ordinary column. `TabletSchema::append_column` preserves its earlier
name-map entry when the scanner adds the extracted Variant path; the separate
path map still binds the scan slot correctly. A scored
`SEARCH('mixedRoot.key:hit')` now fails with `Score query is not supported
without inverted index` because it inspects the unindexed scalar. On the base,
the mixed-case logical name misses and the dynamic typed-template resolver
finds the actual Variant index. Please resolve by path and parent identity, and
cover this legal dotted-column collision.
--
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]