@Test
public void testSkip() throws Exception {

    TableSchema schema = new TableSchema(new String[]{"c0", "c1", "c2"},
        new TypeInformation<?>[]{Types.STRING, Types.DOUBLE, Types.STRING});
    TableSchema outSchema = new TableSchema(new String[]{"c0", "out"},
        new TypeInformation<?>[]{Types.STRING, VectorTypes.VECTOR});
    Params params = new Params()
        .set(VectorAssemblerParams.SELECTED_COLS, new String[]{"c0", "c1", "c2"})
        .set(VectorAssemblerParams.OUTPUT_COL, "out")
        .set(VectorAssemblerParams.HANDLE_INVALID, HandleInvalidMethod.SKIP)
        .set(VectorAssemblerParams.RESERVED_COLS, new String[]{"c0"});
    VectorAssemblerMapper mapper = new VectorAssemblerMapper(schema, params);
    /* skip the invalid data. */
    assertEquals(mapper.map(Row.of(new DenseVector(new double[]{3.0, 4.0}), null, new SparseVector(11, new int[]{0, 10}, new double[]{1.0, 4.0}))).getField(1),
        null);
    assertEquals(mapper.getOutputSchema(), outSchema);
}