use of io.druid.segment.VirtualColumn in project druid by druid-io.
the class VirtualColumnsTest method testSerde.
@Test
public void testSerde() throws Exception {
final ObjectMapper mapper = new DefaultObjectMapper();
final ImmutableList<VirtualColumn> theColumns = ImmutableList.<VirtualColumn>of(new ExpressionVirtualColumn("expr", "x + y"), new ExpressionVirtualColumn("expr2", "x + z"));
final VirtualColumns virtualColumns = VirtualColumns.create(theColumns);
Assert.assertEquals(virtualColumns, mapper.readValue(mapper.writeValueAsString(virtualColumns), VirtualColumns.class));
Assert.assertEquals(theColumns, mapper.readValue(mapper.writeValueAsString(virtualColumns), mapper.getTypeFactory().constructParametricType(List.class, VirtualColumn.class)));
}
Aggregations