@Test public void testFirst() { Schema fieldSchema = Schema.of(Schema.Type.INT); Schema schema = Schema.recordOf("test", Schema.Field.of("x", Schema.nullableOf(fieldSchema))); test(new First("x", fieldSchema), schema, "x", 1, Arrays.asList(1, 2, 3, 4, 5), new First("x", fieldSchema)); test(new First("x", fieldSchema), schema, "x", null, Arrays.asList(null, 2, 3, 4, 5), new First("x", fieldSchema)); }
public First(String fieldName, Schema fieldSchema) { this.fieldName = fieldName; this.fieldSchema = fieldSchema; }
First implements SelectionFunction, AggregateFunction<T, First<T>> { public First(String fieldName, Schema fieldSchema) { this.fieldName = fieldName; this.fieldSchema = fieldSchema; } }
First implements SelectionFunction, AggregateFunction<T, First<T>> { public First(String fieldName, Schema fieldSchema) { this.fieldName = fieldName; this.fieldSchema = fieldSchema; } First(String fieldName, Schema fieldSchema); }
First implements SelectionFunction, AggregateFunction<T, First<T>> { public First(String fieldName, Schema fieldSchema) { this.fieldName = fieldName; this.fieldSchema = fieldSchema; } First(String fieldName, Schema fieldSchema); @Override void initialize(); @Override void mergeValue(StructuredRecord record); @Override void mergeAggregates(First<T> otherAgg); @Override T getAggregate(); @Override Schema getOutputSchema(); @Override StructuredRecord select(StructuredRecord record1, StructuredRecord record2); }
First implements SelectionFunction, AggregateFunction<T, First<T>> { public First(String fieldName, Schema fieldSchema) { this.fieldName = fieldName; this.fieldSchema = fieldSchema; } First(String fieldName, Schema fieldSchema); @Override void initialize(); @Override void mergeValue(StructuredRecord record); @Override void mergeAggregates(First<T> otherAgg); @Override T getAggregate(); @Override Schema getOutputSchema(); @Override StructuredRecord select(StructuredRecord record1, StructuredRecord record2);  }