public void union() {
JavaTableRDD a = sc.sql2rdd("select * from users_java where name = \"A\"");
JavaTableRDD b = sc.sql2rdd("select * from users_java where name = \"B\"");
JavaTableRDD union = a.union(b);
Assert.assertEquals(3, union.count());
List<String> uniqueNames = union.map(new Function<Row, String>() {
@Override
public String call(Row row) throws Exception {
return row.getString("name");
}
}).distinct().collect();