FilterPredicateFactoryTest.java 文件源码

java
阅读 48 收藏 0 点赞 0 评论 0

项目:graphflow 作者:
@Test
public void testInClausePredicateMatchLiteral() {
    String propertyKey = "views";
    List<Pair<String, String>> variables = new ArrayList<>();
    variables.add(new Pair<>("b", propertyKey));

    List<String> literals = new ArrayList<>();
    literals.add("40");
    InClausePredicate inClausePredicate = TestUtils.createInClausePredicate(
        new Pair<>("a", propertyKey), variables, literals);
    List<QueryPredicate> queryPredicates = new ArrayList<>();
    queryPredicates.add(inClausePredicate);

    Map<String, Integer> descriptorIndexMap = new HashMap<>();
    descriptorIndexMap.put("a." + propertyKey, 0);
    descriptorIndexMap.put("b." + propertyKey, 1);
    Predicate<String[]> predicate = PredicateFactory.getFilterPredicate(queryPredicates,
        descriptorIndexMap);
    String[] resolvedProperties = {"40", "20"};
    Assert.assertTrue(predicate.test(resolvedProperties));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号