private Page[] getPages() { Page[] pages = this.pages; if (isReversed) { pages = AggregationTestUtils.reverseColumns(pages); } if (offset > 0) { pages = AggregationTestUtils.offsetColumns(pages, offset); } return pages; }
public static Object aggregation(InternalAggregationFunction function, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = aggregation(function, createArgs(function), Optional.empty(), pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = aggregation(function, reverseArgs(function), Optional.empty(), reverseColumns(pages)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with reversed channels"); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = aggregation(function, offsetArgs(function, 3), Optional.empty(), offsetColumns(pages, 3)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with channel offset"); return aggregation; }
public static Object partialAggregation(InternalAggregationFunction function, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = partialAggregation(function, createArgs(function), pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = partialAggregation(function, reverseArgs(function), reverseColumns(pages)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with reversed channels"); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = partialAggregation(function, offsetArgs(function, 3), offsetColumns(pages, 3)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with channel offset"); return aggregation; }
public static Object groupedAggregation(BiFunction<Object, Object, Boolean> isEqual, InternalAggregationFunction function, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = groupedAggregation(function, createArgs(function), pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = groupedAggregation(function, reverseArgs(function), reverseColumns(pages)); assertFunctionEquals(isEqual, "Inconsistent results with reversed channels", aggregationWithOffset, aggregation); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = groupedAggregation(function, offsetArgs(function, 3), offsetColumns(pages, 3)); assertFunctionEquals(isEqual, "Consistent results with channel offset", aggregationWithOffset, aggregation); return aggregation; }
public static Object groupedPartialAggregation(BiFunction<Object, Object, Boolean> isEqual, InternalAggregationFunction function, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = groupedPartialAggregation(function, createArgs(function), pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = groupedPartialAggregation(function, reverseArgs(function), reverseColumns(pages)); assertFunctionEquals(isEqual, "Consistent results with reversed channels", aggregationWithOffset, aggregation); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = groupedPartialAggregation(function, offsetArgs(function, 3), offsetColumns(pages, 3)); assertFunctionEquals(isEqual, "Consistent results with channel offset", aggregationWithOffset, aggregation); return aggregation; }
public static Object aggregation(InternalAggregationFunction function, double confidence, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = aggregation(function, createArgs(function), Optional.empty(), confidence, pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = aggregation(function, reverseArgs(function), Optional.empty(), confidence, reverseColumns(pages)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with reversed channels"); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = aggregation(function, offsetArgs(function, 3), Optional.empty(), confidence, offsetColumns(pages, 3)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with channel offset"); return aggregation; }
public static Object partialAggregation(InternalAggregationFunction function, double confidence, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = partialAggregation(function, confidence, createArgs(function), pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = partialAggregation(function, confidence, reverseArgs(function), reverseColumns(pages)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with reversed channels"); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = partialAggregation(function, confidence, offsetArgs(function, 3), offsetColumns(pages, 3)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with channel offset"); return aggregation; }
public static Object groupedAggregation(InternalAggregationFunction function, double confidence, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = groupedAggregation(function, confidence, createArgs(function), pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = groupedAggregation(function, confidence, reverseArgs(function), reverseColumns(pages)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with reversed channels"); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = groupedAggregation(function, confidence, offsetArgs(function, 3), offsetColumns(pages, 3)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with channel offset"); return aggregation; }
public static Object groupedPartialAggregation(InternalAggregationFunction function, double confidence, Page... pages) { // execute with args in positions: arg0, arg1, arg2 Object aggregation = groupedPartialAggregation(function, confidence, createArgs(function), pages); // execute with args in reverse order: arg2, arg1, arg0 if (function.getParameterTypes().size() > 1) { Object aggregationWithOffset = groupedPartialAggregation(function, confidence, reverseArgs(function), reverseColumns(pages)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with reversed channels"); } // execute with args at an offset (and possibly reversed): null, null, null, arg2, arg1, arg0 Object aggregationWithOffset = groupedPartialAggregation(function, confidence, offsetArgs(function, 3), offsetColumns(pages, 3)); assertEquals(aggregationWithOffset, aggregation, "Inconsistent results with channel offset"); return aggregation; }