>From Ali Alsuliman <[email protected]>:

Attention is currently required from: Ritik Raj.

Ali Alsuliman has posted comments on this change by Ritik Raj. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20410?usp=email )

Change subject: [ASTERIXDB-3650][COMP] Ignore sample indexes when checking for 
secondary indexes
......................................................................


Patch Set 3:

(2 comments)

File 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/PushFieldAccessRule.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20410/comment/3ce8910b_4455c5a9?usp=email
 :
PS3, Line 155:         List<Index> datasetIndexes =
Add the following to MetadataProvider:
```
/**
 * Returns true if the dataset has any (non-samples) secondary index.
 */
public boolean hasSecondaryIndexes(Dataset ds) throws AlgebricksException {
  return getDatasetIndexes(ds.getDatabaseName(), ds.getDataverseName(), 
ds.getDatasetName()).stream().anyMatch(idx -> idx.isSecondaryIndex() && 
!idx.isSampleIndex());
}
```
Then do:
```
return mp.hasSecondaryIndexes(dataset);
```


File 
asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/DatasetUtil.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20410/comment/4af42280_f4e3770d?usp=email
 :
PS3, Line 488:         boolean hasSecondaries = 
hasNonSampleSecondaryIndex(dataset, metadataProvider);
Change to:
```
metadataProvider.hasSecondaryIndexes(dataset);
```



--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20410?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: asterixdb
Gerrit-Branch: phoenix
Gerrit-Change-Id: I65ca9c74192d14bbaecf8a306902e4cecf1337d2
Gerrit-Change-Number: 20410
Gerrit-PatchSet: 3
Gerrit-Owner: Ritik Raj <[email protected]>
Gerrit-Reviewer: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Attention: Ritik Raj <[email protected]>
Gerrit-Comment-Date: Thu, 25 Sep 2025 22:19:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Reply via email to