@Test
public void testzfilterRecord() throws SqlParseException, ValidationException, RelConversionException {

  Schema subRecSchema = SchemaBuilder.record("SubRecord")
          .fields().name("key").type().stringType().noDefault()
          .requiredString("value").endRecord();
  Schema recBSchema = SchemaBuilder.record("RecordB")
          .fields().name("id").type().intType().noDefault()
          .requiredString("name")
          .requiredString("text")
          .name("adate").type(Schemas.dateString()).noDefault()
          .name("meta").type(Schema.createArray(subRecSchema)).noDefault()
          .name("meta2").type(subRecSchema).noDefault()
          .endRecord();
  GenericRecord subRec = new GenericData.Record(subRecSchema);
  subRec.put("key", "key1");
  subRec.put("value", "val1");
  GenericRecord recb1 =  new GenericData.Record(recBSchema);
  recb1.put("id", 1);
  recb1.put("name", "Beam");
  recb1.put("text", "bla");
  recb1.put("adate", LocalDate.now());
  recb1.put("meta", Collections.singletonList(subRec));
  recb1.put("meta2", subRec);
  Predicate<IndexedRecord> p = FilterUtils.toPredicate("name = 'Beam'", recBSchema);
  assertTrue(p.test(recb1));
  Predicate<IndexedRecord> p2 = FilterUtils.toPredicate("name is null or text like '%bla%'", recBSchema);
  assertTrue(p2.test(recb1));
  Predicate<IndexedRecord> p3 = FilterUtils.toPredicate("name is null", recBSchema);
  assertFalse(p3.test(recb1));
}