@Test public void testEmbeddingFormat() throws Exception { GradoopId a = GradoopId.get(); GradoopId b = GradoopId.get(); Embedding embedding = new Embedding(); embedding.add(a); embedding.add(b); List<Embedding> result = new ArrayList<>(); new AdoptEmptyPaths(1, -1).flatMap(embedding, new ListCollector<>(result)); assertTrue(result.get(0).getIdList(2).isEmpty()); assertEquals(b, result.get(0).getId(3)); }
@Override public void flatMap(Embedding value, Collector<Embedding> out) { if (closingColumn >= 0 && !ArrayUtils.isEquals(value.getRawId(expandColumn), value.getRawId(closingColumn))) { return; } value.add(); value.add(value.getId(expandColumn)); out.collect(value); }
AdoptEmptyPaths extends RichFlatMapFunction<Embedding, Embedding> { @Override public void flatMap(Embedding value, Collector<Embedding> out) { if (closingColumn >= 0 && !ArrayUtils.isEquals(value.getRawId(expandColumn), value.getRawId(closingColumn))) { return; } value.add(); value.add(value.getId(expandColumn)); out.collect(value); } }
AdoptEmptyPaths extends RichFlatMapFunction<Embedding, Embedding> { @Override public void flatMap(Embedding value, Collector<Embedding> out) { if (closingColumn >= 0 && !ArrayUtils.isEquals(value.getRawId(expandColumn), value.getRawId(closingColumn))) { return; } value.add(); value.add(value.getId(expandColumn)); out.collect(value); } AdoptEmptyPaths(int expandColumn, int closingColumn); }
AdoptEmptyPaths extends RichFlatMapFunction<Embedding, Embedding> { @Override public void flatMap(Embedding value, Collector<Embedding> out) { if (closingColumn >= 0 && !ArrayUtils.isEquals(value.getRawId(expandColumn), value.getRawId(closingColumn))) { return; } value.add(); value.add(value.getId(expandColumn)); out.collect(value); } AdoptEmptyPaths(int expandColumn, int closingColumn); @Override void flatMap(Embedding value, Collector<Embedding> out); }
AdoptEmptyPaths extends RichFlatMapFunction<Embedding, Embedding> { @Override public void flatMap(Embedding value, Collector<Embedding> out) { if (closingColumn >= 0 && !ArrayUtils.isEquals(value.getRawId(expandColumn), value.getRawId(closingColumn))) { return; } value.add(); value.add(value.getId(expandColumn)); out.collect(value); } AdoptEmptyPaths(int expandColumn, int closingColumn); @Override void flatMap(Embedding value, Collector<Embedding> out);  }