>From Dmitry Lychagin <[email protected]>:

Dmitry Lychagin has posted comments on this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14043 )

Change subject: [NO ISSUE][COMP] Make views utilize secondary indexes
......................................................................


Patch Set 4: Code-Review+2

(1 comment)

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14043/4/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/BTreeAccessMethod.java
File 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/BTreeAccessMethod.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14043/4/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/BTreeAccessMethod.java@1049
PS4, Line 1049:         if (AccessMethodUtils.isFieldAccess(funId)) {
minor. I'd rewrite this final step check as follows:
------
if (defaultNull) {
   if (!CAST_NULL_TYPE_CONSTRUCTORS.contains(funId)) {
     return false;
   }
   IAType nonNullableType = Index.getNonNullableType(indexedFieldType).first;
   FunctionIdentifier indexedFieldConstructor = 
TypeUtil.getTypeConstructorDefaultNull(nonNullableType);
   // index should have CAST (DEFAULT NULL) and the applied function should be 
the same as the indexed field
   return funId.equals(indexedFieldConstructor);
} else {
   return AccessMethodUtils.isFieldAccess(funId);
}
-----
It seems easier to understand this way. Let's do add it to your next change.



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

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I7ae50a7ccad9dc4dd2df221c4c643a4af04367b9
Gerrit-Change-Number: 14043
Gerrit-PatchSet: 4
Gerrit-Owner: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Dmitry Lychagin <[email protected]>
Gerrit-Reviewer: Glenn Galvizo <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Till Westmann <[email protected]>
Gerrit-Comment-Date: Tue, 16 Nov 2021 19:01:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Reply via email to