RaphaelSanamyan commented on a change in pull request #15052:
URL: https://github.com/apache/beam/pull/15052#discussion_r662372325
##########
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:
Yes, you're right. I moved this part of the code because it will let to
use the class without the statement and at the same time it just extends this
class without breaking compatibility.
--
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]