kennknowles commented on code in PR #35949:
URL: https://github.com/apache/beam/pull/35949#discussion_r2429887199
##########
sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java:
##########
@@ -1088,6 +1164,209 @@ abstract Builder<ParameterT> setParametersFunction(
}
}
+ /**
+ * This is the class which handles the work behind the {@link
#writeUnwindWithResults()} method.
+ */
+ @AutoValue
+ public abstract static class WriteUnwindWithResults<ParameterT>
+ extends PTransform<PCollection<ParameterT>,
PCollection<Neo4jWriteStats>> {
+
+ abstract @Nullable SerializableFunction<Void, Driver>
getDriverProviderFn();
+
+ abstract @Nullable ValueProvider<SessionConfig> getSessionConfig();
+
+ abstract @Nullable ValueProvider<String> getCypher();
+
+ abstract @Nullable ValueProvider<String> getUnwindMapName();
+
+ abstract @Nullable ValueProvider<TransactionConfig> getTransactionConfig();
+
+ abstract @Nullable SerializableFunction<ParameterT, Map<String, Object>>
+ getParametersFunction();
+
+ abstract @Nullable ValueProvider<Long> getBatchSize();
Review Comment:
Now that we have flex templates, I believe the recommendation is to use
ordinary fields here, and you can pull their values from pipeline options.
Is that right @damccorm @Abacn ?
##########
sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java:
##########
@@ -183,6 +189,64 @@ public class Neo4jIO {
private static final Logger LOG = LoggerFactory.getLogger(Neo4jIO.class);
+ /**
+ * Represents write statistics from a Neo4j UNWIND operation, used by
WriteUnwindWithResults.
+ * Contains metrics such as the number of nodes created, relationships
created, and properties
+ * set.
+ */
+ @DefaultCoder(AvroCoder.class)
Review Comment:
I wonder if `@DefaultSchema` would be preferable for automatic encoding. Is
that right @reuvenlax ?
--
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]