use of com.amazonaws.athena.connector.lambda.udf.UserDefinedFunctionRequest in project aws-athena-query-federation by awslabs.
the class UserDefinedFunctionRequestSerDeTest method beforeTest.
@Before
public void beforeTest() throws IOException {
Schema inputSchema = SchemaBuilder.newBuilder().addField("factor1", Types.MinorType.INT.getType()).addField("factor2", Types.MinorType.INT.getType()).build();
Schema outputSchema = SchemaBuilder.newBuilder().addField("product", Types.MinorType.INT.getType()).build();
Block inputRecords = allocator.createBlock(inputSchema);
inputRecords.setRowCount(1);
IntVector inputVector1 = (IntVector) inputRecords.getFieldVector("factor1");
IntVector inputVector2 = (IntVector) inputRecords.getFieldVector("factor2");
inputVector1.setSafe(0, 2);
inputVector2.setSafe(0, 3);
expected = new UserDefinedFunctionRequest(federatedIdentity, inputRecords, outputSchema, "test-method", UserDefinedFunctionType.SCALAR);
String expectedSerDeFile = utils.getResourceOrFail("serde/v2", "UserDefinedFunctionRequest.json");
expectedSerDeText = utils.readAllAsString(expectedSerDeFile).trim();
}
Aggregations