>From Ritik Raj <[email protected]>:

Ritik Raj has uploaded a new patch set (#2). ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20943?usp=email )


Change subject: [ASTERIXDB-3708][COMP] Fix empty results with columnar 
secondary index
......................................................................

[ASTERIXDB-3708][COMP] Fix empty results with columnar secondary index

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
When querying a columnar dataset with a secondary index, LIMIT clause,
and field projection (e.g., SELECT VALUE h FROM d1 WHERE
cac_email_domain > 3 LIMIT 2), the query returns empty results with
certain execution sequences.

Root cause: PushLimitIntoPrimarySearchRule moves the SELECT condition
into the UNNEST_MAP operator before field access pushdown.
PushdownOperatorVisitor was calling visitInputs BEFORE registering the
dataset for UnnestMapOperator and LeftOuterUnnestMapOperator. This
timing issue prevented filter fields from being captured in the
def-use chain, so the columnar projection schema only included output
fields but not filter fields.

Fix: Changed PushdownOperatorVisitor to call registerDatasetIfApplicable
BEFORE visitInputs for UnnestMapOperator and LeftOuterUnnestMapOperator,
aligning with the existing pattern for DataSourceScanOperator. This
ensures filter field accesses are properly linked to the scan definition,
causing the projection schema to include both output and filter fields.

Added regression test in column/secondary-index/projection-filter/ to
validate the fix.

Ext-ref: MB-70725
Change-Id: I26e5357141ff77ee210f89b4e93e1e4c33eb6845
---
M 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/visitor/PushdownOperatorVisitor.java
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/projection-filter/projection-filter.001.ddl.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/projection-filter/projection-filter.002.update.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/projection-filter/projection-filter.003.get.http
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/projection-filter/projection-filter.005.ddl.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/projection-filter/projection-filter.006.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/projection-filter/projection-filter.007.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/projection-filter/projection-filter.003.regexadm
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/projection-filter/projection-filter.006.adm
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/projection-filter/projection-filter.007.adm
M 
asterixdb/asterix-app/src/test/resources/runtimets/testsuite_single_partition_sqlpp.xml
11 files changed, 147 insertions(+), 2 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/43/20943/2
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20943?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: I26e5357141ff77ee210f89b4e93e1e4c33eb6845
Gerrit-Change-Number: 20943
Gerrit-PatchSet: 2
Gerrit-Owner: Ritik Raj <[email protected]>
Gerrit-CC: Jenkins <[email protected]>

Reply via email to