@Override public void prepareRun(BatchAggregatorContext context) throws Exception { if ("long".equalsIgnoreCase(config.fieldType)) { context.setGroupKeyClass(Long.class); } else { context.setGroupKeyClass(String.class); } }
@Override public void prepareRun(BatchAggregatorContext context) throws Exception { if (numPartitions != null) { context.setNumPartitions(numPartitions); } } }
@Override public void prepareRun(BatchAggregatorContext context) throws Exception { super.prepareRun(context); LinkedList<FieldOperation> fllOperations = new LinkedList<>(); // in configurePipeline all the necessary checks have been performed already to set output schema if (SchemaValidator.canRecordLineage(context.getOutputSchema(), "output")) { Schema inputSchema = context.getInputSchema(); // for every function record the field level operation details for (GroupByConfig.FunctionInfo functionInfo : conf.getAggregates()) { Schema.Field outputSchemaField = getOutputSchemaField(functionInfo, inputSchema); String operationName = String.format("Group %s", functionInfo.getField()); String description = String.format("Aggregate function applied: '%s'.", functionInfo.getFunction()); FieldOperation operation = new FieldTransformOperation(operationName, description, Collections.singletonList(functionInfo.getField()), outputSchemaField.getName()); fllOperations.add(operation); } } context.record(fllOperations); }
@Override public void prepareRun(BatchAggregatorContext context) throws Exception { if (conf.numPartitions != null) { context.setNumPartitions(conf.numPartitions); } }