>From Hongyu Shi <[email protected]>:
Attention is currently required from: Hongyu Shi.
Hello Anon. E. Moose #1000171, Jenkins,
I'd like you to reexamine a change. Please visit
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21651?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Integration-Tests+1 by Jenkins, Verified+1 by Jenkins
Change subject: [WIP][ASTERIXDB-3817][COMP] Do not rewrite a back-to-front
ann_distance
......................................................................
[WIP][ASTERIXDB-3817][COMP] Do not rewrite a back-to-front ann_distance
- user model changes: yes
- storage format changes: no
- interface changes: no
Details:
ann_distance(queryVector, field, metric) failed during plan generation
with "Could not resolve type for $$n". createIndexSearchPlan reads
argument 1 as the query vector while the shared
one-constant-one-variable analysis accepts the two in either order, so a
back-to-front call put the indexed field into the query-vector slot
where its variable does not resolve against the index search's own
input. Reject that shape before the shared analysis runs, the way the
asymmetric contains() functions already do inside it. The call itself is
valid because the metrics are symmetric, so it now falls back to exact
evaluation like vector_distance and returns the same rows as the
rewritable order.
That fallback is correct but silent: the user writes ann_distance, has a
vector index, gets the right rows and quietly gets a full scan. Report
it as an INAPPLICABLE_HINT warning, which is what the access method
rules already raise for a hint they cannot apply. The warning is
confined to the swapped shape, so argument 0 has to be a runtime
constant rather than merely a non-variable: when both arguments vary per
row there is no fixed probe point at all and the rewrite declines for a
reason this text would misdescribe. The annotation is dropped once
reported because the access method rules run to a fixpoint and this path
is not marked in the don't-apply set, so the hint would otherwise be
warned about once a pass.
Ext-ref: MB-73348
Co-Authored-By: Claude Opus 5 <[email protected]>
Change-Id: I4ce84b44b36b5f8188beedf357e2971c9bcadd9d
---
M
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/VectorIndexAccessMethod.java
M
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/VectorQueries.xml
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.01.ddl.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.02.update.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.03.ddl.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.04.ddl.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.05.query.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.06.query.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.07.query.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.99.ddl.sqlpp
A
asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.05.adm
A
asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.06.adm
A
asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-swapped-args/create-index-vtree-swapped-args.07.adm
13 files changed, 287 insertions(+), 1 deletion(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/51/21651/4
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21651?usp=email
To unsubscribe, or for help writing mail filters, visit
https://asterix-gerrit.ics.uci.edu/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4ce84b44b36b5f8188beedf357e2971c9bcadd9d
Gerrit-Change-Number: 21651
Gerrit-PatchSet: 4
Gerrit-Owner: Hongyu Shi <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Attention: Hongyu Shi <[email protected]>