use of com.alibaba.alink.pipeline.dataproc.JsonValue in project Alink by alibaba.
the class JsonValueBatchOpTest method test3.
@Test
public void test3() throws Exception {
Row[] testArray = new Row[] { Row.of("{\"ak\":1,\"dd\":1}") };
String[] colnames = new String[] { "jsoncol" };
MemSourceBatchOp inOp = new MemSourceBatchOp(Arrays.asList(testArray), colnames);
List<Row> result = (new Pipeline().add(new JsonValue().setSkipFailed(true).setOutputColTypes(new String[] { "string", "string" }).setSelectedCol("jsoncol").setOutputCols(new String[] { "jsonval", "jv" }).setJsonPath("$.ak", "$.ck"))).fit(inOp).transform(inOp).collect();
Assert.assertNull(result.get(0).getField(2));
}
Aggregations