@Test public void testExecute() throws Exception { String query = "MATCH (a)-->(b) WHERE a.age > b.age"; QueryHandler queryHandler = new QueryHandler(query); CNF filterPredicate = queryHandler.getPredicates().getSubCNF(Sets.newHashSet("a", "b")); GradoopId vertexAId = GradoopId.get(); GradoopId vertexBId = GradoopId.get(); GradoopId vertexCId = GradoopId.get(); EmbeddingMetaData metaData = new EmbeddingMetaData(); metaData.setEntryColumn("a", EntryType.VERTEX, 0); metaData.setEntryColumn("b", EntryType.VERTEX, 1); metaData.setPropertyColumn("a", "age", 0); metaData.setPropertyColumn("b", "age", 1); Embedding embedding1 = new Embedding(); embedding1.add(vertexAId, PropertyValue.create(42)); embedding1.add(vertexBId, PropertyValue.create(23)); Embedding embedding2 = new Embedding(); embedding2.add(vertexAId, PropertyValue.create(42)); embedding2.add(vertexCId, PropertyValue.create(84)); DataSet<Embedding> input = getExecutionEnvironment().fromElements(embedding1, embedding2); PlanNode mockChild = new MockPlanNode(input, metaData); List<Embedding> result = new FilterEmbeddingsNode(mockChild, filterPredicate).execute().collect(); assertThat(result.size(), is(1)); assertTrue(result.get(0).getId(0).equals(vertexAId)); assertTrue(result.get(0).getId(1).equals(vertexBId)); assertTrue(result.get(0).getProperty(0).equals(PropertyValue.create(42))); assertTrue(result.get(0).getProperty(1).equals(PropertyValue.create(23))); }
@Override public DataSet<Embedding> execute() { FilterEmbeddings op = new FilterEmbeddings(getChildNode().execute(), filterPredicate, getEmbeddingMetaData()); op.setName(toString()); return op.evaluate(); }
FilterEmbeddingsNode extends UnaryNode implements FilterNode { @Override public DataSet<Embedding> execute() { FilterEmbeddings op = new FilterEmbeddings(getChildNode().execute(), filterPredicate, getEmbeddingMetaData()); op.setName(toString()); return op.evaluate(); } }
FilterEmbeddingsNode extends UnaryNode implements FilterNode { @Override public DataSet<Embedding> execute() { FilterEmbeddings op = new FilterEmbeddings(getChildNode().execute(), filterPredicate, getEmbeddingMetaData()); op.setName(toString()); return op.evaluate(); } FilterEmbeddingsNode(PlanNode childNode, CNF filterPredicate); }
FilterEmbeddingsNode extends UnaryNode implements FilterNode { @Override public DataSet<Embedding> execute() { FilterEmbeddings op = new FilterEmbeddings(getChildNode().execute(), filterPredicate, getEmbeddingMetaData()); op.setName(toString()); return op.evaluate(); } FilterEmbeddingsNode(PlanNode childNode, CNF filterPredicate); @Override DataSet<Embedding> execute(); CNF getFilterPredicate(); @Override String toString(); }
FilterEmbeddingsNode extends UnaryNode implements FilterNode { @Override public DataSet<Embedding> execute() { FilterEmbeddings op = new FilterEmbeddings(getChildNode().execute(), filterPredicate, getEmbeddingMetaData()); op.setName(toString()); return op.evaluate(); } FilterEmbeddingsNode(PlanNode childNode, CNF filterPredicate); @Override DataSet<Embedding> execute(); CNF getFilterPredicate(); @Override String toString();  }