fix: schema not cached in spark/flink loader (#334) master
authoralan.zhao <30570711+haohao0103@users.noreply.github.com>
Tue, 20 Sep 2022 10:24:45 +0000 (18:24 +0800)
committerGitHub <noreply@github.com>
Tue, 20 Sep 2022 10:24:45 +0000 (18:24 +0800)
hugegraph-loader/src/main/java/com/baidu/hugegraph/loader/flink/HugeGraphOutputFormat.java
hugegraph-loader/src/main/java/com/baidu/hugegraph/loader/spark/HugeGraphSparkLoader.java

index a37c73c37d0f5c74d1bd6e6767cff91963017166..edc503fde742571f75160fa3ac4a6bf6d442a15d 100644 (file)
@@ -90,6 +90,7 @@ public class HugeGraphOutputFormat<T> extends RichOutputFormat<T> {
             builders.put(new EdgeBuilder(loadContext, this.struct, edgeMapping),
                          new ArrayList<>());
         }
+        loadContext.updateSchemaCache();
         return builders;
     }
 
index ec94cf1905811d3e411d6caf2d95d02725216ed2..143dd2f0b80e796da95082ecac46d995c42c1f95 100644 (file)
@@ -117,6 +117,7 @@ public class HugeGraphSparkLoader implements Serializable {
             this.builders.put(new EdgeBuilder(context, struct, edgeMapping),
                               new ArrayList<>());
         }
+        context.updateSchemaCache();
         return context;
     }