@Test public void testColumnTransformer() throws Exception { ColumnTransformer transformer = new ColumnTransformer(); assertTrue(transformer.getSchema().isEmpty()); Map<String, Function> map = new HashMap<>(); map.put("trafo", new StringLiteralFunction("transformed")); transformer = new ColumnTransformer(map); assertTrue(transformer.hasPseudoColumn("trafo")); assertEquals("transformed", transformer.get("trafo", new MockDataset())); assertEquals("value", transformer.get("column", new MockDataset())); Dataset dsTransformed = transformer.transform(new MockDataset()); assertEquals("transformed", dsTransformed.get("trafo")); assertEquals("ds", dsTransformed.getKey()); QueryResults results = new MockQueryResults(); QueryResults transformedResults = transformer.transform(results); assertFalse(transformedResults.isEmpty()); assertEquals(1, transformedResults.size()); Iterator<Dataset> iter = transformedResults.iterator(); assertTrue(iter.hasNext()); assertEquals("ds", iter.next().getKey()); assertThrows(UnsupportedOperationException.class, () -> iter.remove()); }
public ColumnTransformer(Map<String, Function> trafos) { addTrafos(trafos); }
ColumnTransformer { public ColumnTransformer(Map<String, Function> trafos) { addTrafos(trafos); } }
ColumnTransformer { public ColumnTransformer(Map<String, Function> trafos) { addTrafos(trafos); } ColumnTransformer(Map<String, Function> trafos);  ColumnTransformer(); }
ColumnTransformer { public ColumnTransformer(Map<String, Function> trafos) { addTrafos(trafos); } ColumnTransformer(Map<String, Function> trafos);  ColumnTransformer(); boolean hasPseudoColumn(String name); List<String> getSchema(); String get(String columnName, Dataset ds); Dataset transform(Dataset ds); QueryResults transform(QueryResults qres); }
ColumnTransformer { public ColumnTransformer(Map<String, Function> trafos) { addTrafos(trafos); } ColumnTransformer(Map<String, Function> trafos);  ColumnTransformer(); boolean hasPseudoColumn(String name); List<String> getSchema(); String get(String columnName, Dataset ds); Dataset transform(Dataset ds); QueryResults transform(QueryResults qres);  }