zstan commented on code in PR #1476:
URL: https://github.com/apache/ignite-3/pull/1476#discussion_r1058339901
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/RexUtils.java:
##########
@@ -361,46 +364,58 @@ public static List<SearchBounds> buildHashIndexConditions(
}
/**
- * Builds index conditions.
+ * Builds hash index search bounds.
*/
- public static List<RexNode> buildHashSearchRow(
+ public static List<SearchBounds> buildHashSearchBounds(
RelOptCluster cluster,
RexNode condition,
- RelDataType rowType
+ RelDataType rowType,
+ @Nullable ImmutableBitSet requiredColumns
) {
condition = RexUtil.toCnf(builder(cluster), condition);
- Int2ObjectMap<List<RexCall>> fieldsToPredicates =
mapPredicatesToFields(condition, cluster);
+ Map<Integer, List<RexCall>> fieldsToPredicates =
mapPredicatesToFields(condition, cluster);
if (nullOrEmpty(fieldsToPredicates)) {
return null;
}
- List<RexNode> searchPreds = null;
+ List<SearchBounds> bounds = null;
+
+ List<RelDataType> types = RelOptUtil.getFieldTypeList(rowType);
+
+ Mappings.TargetMapping mapping = null;
+
+ if (requiredColumns != null) {
+ mapping = Commons.inverseTrimmingMapping(types.size(),
requiredColumns);
+ }
+
+ for (int fldIdx : fieldsToPredicates.keySet()) {
Review Comment:
does it comment relates to
https://github.com/apache/ignite-3/pull/1476#discussion_r1058253008 ? Or you
talking about fieldsToPredicates.keySet() this place ? In such a case we need
fldIdx near.
--
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]