Copilot commented on code in PR #659:
URL: 
https://github.com/apache/incubator-hugegraph-toolchain/pull/659#discussion_r2062480985


##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/task/InsertTask.java:
##########
@@ -111,10 +114,12 @@ protected void insertBatch(List<Record> batch, boolean 
checkVertex) {
         List<GraphElement> elements = new ArrayList<>(batch.size());
         batch.forEach(r -> elements.add(r.element()));
         if (this.type().isVertex()) {
-            client.graph().addVertices((List<Vertex>) (Object) elements);
+            // client.graph().addVertices((List<Vertex>) (Object) elements);
+            this.mettaWriter.writeNodes(batch);
         } else {
-            client.graph().addEdges((List<Edge>) (Object) elements,
-                                    checkVertex);
+            // client.graph().addEdges((List<Edge>) (Object) elements,
+                                    // checkVertex);

Review Comment:
   Remove commented-out production code or provide a clear justification in a 
comment to avoid confusion in the codebase.



##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/writer/MeTTaWriter.java:
##########
@@ -0,0 +1,224 @@
+package org.apache.hugegraph.loader.writer;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.hugegraph.loader.builder.Record;
+import org.apache.hugegraph.structure.graph.Edge;
+import org.apache.hugegraph.structure.graph.Vertex;
+
+public class MeTTaWriter {
+    
+    private static final String OUTPUT_DIR = 
"/home/developer/Desktop/metta_output";
+    
+    public MeTTaWriter() {
+        // Create output directory if it doesn't exist
+        try {
+            Files.createDirectories(Paths.get(OUTPUT_DIR));

Review Comment:
   Consider making the OUTPUT_DIR configurable instead of hardcoding it to 
support different deployment environments.
   ```suggestion
       private final String outputDir;
       
       public MeTTaWriter(String outputDir) {
           this.outputDir = outputDir != null ? outputDir : 
"/home/developer/Desktop/metta_output";
           // Create output directory if it doesn't exist
           try {
               Files.createDirectories(Paths.get(this.outputDir));
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to