Skip to content
Permalink
Browse files
Fix: prase error when data props num is different (#211)
* fix #209

Co-authored-by: DoubleBabylol <18811639296@163.com>
  • Loading branch information
DoubleBabylol and DoubleBabylol committed May 21, 2021
1 parent 5f9aa9b commit ba8555890577c4ddbfd393e19db072fd4906398a
Showing 1 changed file with 5 additions and 1 deletion.
@@ -20,6 +20,7 @@
package com.baidu.hugegraph.loader.builder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -46,6 +47,7 @@ public class EdgeBuilder extends ElementBuilder<Edge> {
private final Collection<String> nonNullKeys;
// Used to optimize access performace
private VertexIdsIndex vertexIdsIndex;
private String[] lastNames;

public EdgeBuilder(LoadContext context, InputStruct struct,
EdgeMapping mapping) {
@@ -69,9 +71,11 @@ public EdgeMapping mapping() {

@Override
public List<Edge> build(String[] names, Object[] values) {
if (this.vertexIdsIndex == null) {
if (this.vertexIdsIndex == null ||
!Arrays.equals(this.lastNames, names)) {
this.vertexIdsIndex = this.extractVertexIdsIndex(names);
}
this.lastNames = names;
EdgeKVPairs kvPairs = this.newEdgeKVPairs();
kvPairs.source.extractFromEdge(names, values,
this.vertexIdsIndex.sourceIndexes);

0 comments on commit ba85558

Please sign in to comment.