/** * Build collation property for project, the one closer to the Scan * @param projectRexs the expressions to project * @param project the project between projectRexs and input, it could be null if no such intermediate project(lower project) * @param input the input RelNode to the project, usually it is the scan operator. * @param indexInfo the index for which we are building index plan * @param context the context of this index planning process * @return the output RelCollation */ public static RelCollation buildCollationProject(List<RexNode> projectRexs, DrillProjectRelBase project, RelNode input, FunctionalIndexInfo indexInfo, IndexCallContext context) { Map<LogicalExpression, Integer> projectExprs = getProjectExprs(projectRexs, project, input); return buildCollationForExpressions(projectExprs, indexInfo.getIndexDesc(), context); }
/** * Build the collation property for index scan * @param indexDesc the index for which we are building index plan * @param context the context of this index planning process * @return the output RelCollation for the scan on index */ public static RelCollation buildCollationCoveringIndexScan(IndexDescriptor indexDesc, IndexCallContext context) { Map<LogicalExpression, Integer> rowTypeExprs = getExprsFromRowType(context.getScan().getRowType()); return buildCollationForExpressions(rowTypeExprs, indexDesc, context); }