You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/07/01 13:59:55 UTC

[GitHub] [beam] aromanenko-dev commented on a change in pull request #15052: [BEAM-12511] JdbcIO.Write.withResult works without statement.

aromanenko-dev commented on a change in pull request #15052:
URL: https://github.com/apache/beam/pull/15052#discussion_r662309221



##########
File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java
##########
@@ -1353,14 +1236,136 @@ void set(
 
     @Override
     public PCollection<Void> expand(PCollection<T> input) {
-      checkArgument(getStatement() != null, "withStatement() is required");
+      WriteVoid<T> spec = this;
       checkArgument(
-          getPreparedStatementSetter() != null, "withPreparedStatementSetter() is required");
-      checkArgument(
-          (getDataSourceProviderFn() != null),
+          (spec.getDataSourceProviderFn() != null),
           "withDataSourceConfiguration() or withDataSourceProviderFn() is required");
+      // fixme: validate invalid table input
+      if (input.hasSchema() && !spec.hasStatementAndSetter()) {

Review comment:
       I expect that this large part of code below is mostly copied from `Write`. Is it correct?




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org