belowAggregateKeyNotShifted.shift(-offset); final boolean unique; if (!allowFunctions) {
belowAggregateKeyNotShifted.shift(-offset); final boolean unique; if (!allowFunctions) {
@Test public void testShift() { final ImmutableBitSet bitSet = ImmutableBitSet.of(29, 4, 1969); assertThat(bitSet.shift(0), is(bitSet)); assertThat(bitSet.shift(1), is(ImmutableBitSet.of(30, 5, 1970))); assertThat(bitSet.shift(-4), is(ImmutableBitSet.of(25, 0, 1965))); try { final ImmutableBitSet x = bitSet.shift(-5); fail("Expected error, got " + x); } catch (ArrayIndexOutOfBoundsException e) { assertThat(e.getMessage(), anyOf(is("-1"), is("Index -1 out of bounds for length 0"))); } final ImmutableBitSet empty = ImmutableBitSet.of(); assertThat(empty.shift(-100), is(empty)); }
@Test public void testShift() { final ImmutableBitSet bitSet = ImmutableBitSet.of(29, 4, 1969); assertThat(bitSet.shift(0), is(bitSet)); assertThat(bitSet.shift(1), is(ImmutableBitSet.of(30, 5, 1970))); assertThat(bitSet.shift(-4), is(ImmutableBitSet.of(25, 0, 1965))); try { final ImmutableBitSet x = bitSet.shift(-5); fail("Expected error, got " + x); } catch (ArrayIndexOutOfBoundsException e) { assertThat(e.getMessage(), anyOf(is("-1"), is("Index -1 out of bounds for length 0"))); } final ImmutableBitSet empty = ImmutableBitSet.of(); assertThat(empty.shift(-100), is(empty)); }
@Override public Prel visitLateral(LateralJoinPrel prel, Boolean isRightOfLateral) throws RuntimeException { List<RelNode> children = Lists.newArrayList(); children.add(((Prel) prel.getInput(0)).accept(this, isRightOfLateral)); children.add(((Prel) prel.getInput(1)).accept(this, true)); if (!isRightOfLateral) { return (Prel) prel.copy(prel.getTraitSet(), children); } else { //Adjust the column numbering due to an additional column "$drill_implicit_field$" is added to the inputs. Map<Integer, Integer> requiredColsMap = new HashMap<>(); for (Integer corrColIndex : prel.getRequiredColumns()) { requiredColsMap.put(corrColIndex, corrColIndex + 1); } ImmutableBitSet requiredColumns = prel.getRequiredColumns().shift(1); CorrelationId corrId = prel.getCluster().createCorrel(); RexCorrelVariable updatedCorrel = (RexCorrelVariable) prel.getCluster().getRexBuilder().makeCorrel( children.get(0).getRowType(), corrId); RelNode rightChild = children.get(1).accept( new CorrelateVarReplacer( new ProjectCorrelateTransposeRule.RexFieldAccessReplacer(prel.getCorrelationId(), updatedCorrel, prel.getCluster().getRexBuilder(), requiredColsMap))); return (Prel) prel.copy(prel.getTraitSet(), children.get(0), rightChild, corrId, requiredColumns, prel.getJoinType()); } }
private static boolean isAggregateKeyApplicable(ImmutableBitSet aggregateKeys, Join join) { JoinInfo joinInfo = join.analyzeCondition(); return (join.getJoinType() == JoinRelType.LEFT && joinInfo.leftSet().contains(aggregateKeys)) || (join.getJoinType() == JoinRelType.RIGHT && joinInfo.rightSet().shift(join.getInput(0).getRowType().getFieldCount()) .contains(aggregateKeys)); }
fieldCount); final ImmutableBitSet belowAggregateKey = belowAggregateKeyNotShifted.shift(-offset); final boolean unique; if (!allowFunctions) {
fieldCount); final ImmutableBitSet belowAggregateKey = belowAggregateKeyNotShifted.shift(-offset); final boolean unique; if (!allowFunctions) {
belowAggregateKeyNotShifted.shift(-offset); final boolean unique; if (!allowFunctions) {