/** * Applies a mapping to a list of field collations. * * @param mapping Mapping * @param fieldCollations Field collations * @return collations with mapping applied */ public static List<RelFieldCollation> applyFields( Mappings.TargetMapping mapping, List<RelFieldCollation> fieldCollations) { final List<RelFieldCollation> newFieldCollations = new ArrayList<RelFieldCollation>(fieldCollations.size()); for (RelFieldCollation fieldCollation : fieldCollations) { newFieldCollations.add(apply(mapping, fieldCollation)); } return newFieldCollations; }
/** * Applies a mapping to a list of field collations. * * @param mapping Mapping * @param fieldCollations Field collations * @return collations with mapping applied */ public static List<RelFieldCollation> applyFields( Mappings.TargetMapping mapping, List<RelFieldCollation> fieldCollations) { final List<RelFieldCollation> newFieldCollations = new ArrayList<RelFieldCollation>(fieldCollations.size()); for (RelFieldCollation fieldCollation : fieldCollations) { newFieldCollations.add(apply(mapping, fieldCollation)); } return newFieldCollations; }
: collation.getFieldCollations()) { final RelFieldCollation newFieldCollation = apply(mapping, fieldCollation); if (newFieldCollation == null) {
apply(mapping, fieldCollation); if (newFieldCollation == null) {
RexUtil.apply( new InputSpecialOpFinder( projRefs,
sort.getTraitSet(), newInput, RexUtil.apply(inputMapping, collation)); assert newSort.getClass() == sort.getClass();
sort.getTraitSet(), newInput, RexUtil.apply(inputMapping, collation)); assert newSort.getClass() == sort.getClass();
RelCollation newCollation = RexUtil.apply(mapping, oldCollation);
RexUtil.apply(visitor, correlatedJoinKeys, null); List<RexFieldAccess> correlatedKeyList = visitor.getFieldAccessList();
RelCollation newCollation = RexUtil.apply(mapping, oldCollation);
RexUtil.apply(inputMapping, project.getCollationList());
RexUtil.apply(visitor, correlatedJoinKeys, null); List<RexFieldAccess> correlatedKeyList = visitor.getFieldAccessList();
RexUtil.apply(inputMapping, project.getCollationList());
public void rewriteRel(SortRel rel) { RelCollation oldCollation = rel.getCollation(); final RelNode oldChild = rel.getChild(); final RelNode newChild = getNewForOldRel(oldChild); final Mappings.TargetMapping mapping = getNewForOldInputMapping(oldChild); // validate for (RelFieldCollation field : oldCollation.getFieldCollations()) { int oldInput = field.getFieldIndex(); RelDataType sortFieldType = oldChild.getRowType().getFieldList().get(oldInput).getType(); if (sortFieldType.isStruct()) { // TODO jvs 10-Feb-2005 throw Util.needToImplement("sorting on structured types"); } } SortRel newRel = new SortRel( rel.getCluster(), rel.getCluster().traitSetOf(Convention.NONE), newChild, RexUtil.apply(mapping, oldCollation)); setNewForOldRel(rel, newRel); }
public void rewriteRel(SortRel rel) { RelCollation oldCollation = rel.getCollation(); final RelNode oldChild = rel.getChild(); final RelNode newChild = getNewForOldRel(oldChild); final Mappings.TargetMapping mapping = getNewForOldInputMapping(oldChild); // validate for (RelFieldCollation field : oldCollation.getFieldCollations()) { int oldInput = field.getFieldIndex(); RelDataType sortFieldType = oldChild.getRowType().getFieldList().get(oldInput).getType(); if (sortFieldType.isStruct()) { // TODO jvs 10-Feb-2005 throw Util.needToImplement("sorting on structured types"); } } RelCollation newCollation = RexUtil.apply(mapping, oldCollation); SortRel newRel = new SortRel( rel.getCluster(), rel.getCluster().traitSetOf(Convention.NONE).plus(newCollation), newChild, newCollation, rel.offset, rel.fetch); setNewForOldRel(rel, newRel); }
RexUtil.apply(map, sort.getCollation())); final SortRel newSort = sort.copy(