haohao0103 commented on PR #334:
URL: 
https://github.com/apache/incubator-hugegraph-toolchain/pull/334#issuecomment-1250796686

   > hi @haohao0103 ,thanks for your contribution. I think maybe it's better to 
updateSchemaCache after `new LoadContext` just like `HugeGraphLoader`, what do 
you think? @imbajin @haohao0103 
https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-loader/src/main/java/com/baidu/hugegraph/loader/spark/HugeGraphSparkLoader.java#L120
   > 
   > ```java
   >     private LoadContext initPartition(
   >             LoadOptions loadOptions, InputStruct struct) {
   >         LoadContext context = new LoadContext(loadOptions);
   >         for (VertexMapping vertexMapping : struct.vertices()) {
   >             this.builders.put(
   >                     new VertexBuilder(context, struct, vertexMapping),
   >                     new ArrayList<>());
   >         }
   >         for (EdgeMapping edgeMapping : struct.edges()) {
   >             this.builders.put(new EdgeBuilder(context, struct, 
edgeMapping),
   >                               new ArrayList<>());
   >         }
   >         context.updateSchemaCache();
   >         return context;
   >     }
   > ```
   
   
我觉得放在这里是可以的,我们第一次就在这里解决的;但是initPartition方法是HugeGraphSparkLoader类私有的;感觉LoadContext对象创建后需要调用initPartition初始化方法才能正确使用,感觉有点不合适哈。个人的浅见。。。。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to