VariantDataset extends ParentDataset<VariantDataset> implements Serializable { public VariantDataset typeFilter(String value) { query.put("type", value); return this; } VariantDataset(SparkSession sparkSession); void reset(); Dataset executeSql(String sql); @Override String getSql(); VariantDataset idFilter(String value); VariantDataset idFilter(List<String> values); VariantDataset idFilter(List<String> values, boolean and); VariantDataset typeFilter(String value); VariantDataset typeFilter(List<String> values); VariantDataset studyFilter(String key, String value); VariantDataset studyFilter(String key, List<String> values); VariantDataset studyFilter(String key, List<String> values, boolean and); VariantDataset sampleFilter(String key, String value); VariantDataset sampleFilter(String key, List<String> values); VariantDataset annotationFilter(String key, String value); VariantDataset annotationFilter(String key, List<String> values); VariantDataset annotationFilter(String key, List<String> values, boolean and); Iterator<Variant> iterator();  }
@Test public void filters() { long count = 0; try { initDataset(); System.out.println("--------------------------------------"); String types = "SNP,SNV"; count = vd.typeFilter(new ArrayList<>(Arrays.asList(StringUtils.split(types, ",")))).count(); System.out.println("--------------------------------------"); System.out.println("count = " + count); System.out.println("--------------------------------------"); vd.sparkSession.sparkContext().stop(); assert(count == 98); } catch (Exception e) { e.printStackTrace(); } vd.sparkSession.sparkContext().stop(); }