ygerzhedovich commented on code in PR #1476:
URL: https://github.com/apache/ignite-3/pull/1476#discussion_r1058256050
##########
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:
Looks like int2ObjectEntrySet() more preferable for the case
--
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]