vitaly-ivanov commented on a change in pull request #16336:
URL: https://github.com/apache/beam/pull/16336#discussion_r774451230
##########
File path:
sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcIOTest.java
##########
@@ -880,6 +881,72 @@ public void testGetPreparedStatementSetCaller() throws
Exception {
verify(psMocked, times(1)).setByte(11, Byte.parseByte("1", 2));
}
+ @Test
+ public void testGetPreparedStatementSetNullsCaller() throws Exception {
+
+ Schema schema =
+ Schema.builder()
+ // primitive
+ .addField("bigint_col", Schema.FieldType.INT64.withNullable(true))
Review comment:
I think it should be handled on the Schema validation level but not
while setting the PreparedStatement value.
I have just tested this case, and I have not been able to create Row with a
null value in the non-nullable field. It has failed with
```
java.lang.IllegalArgumentException: INT64 NOT NULL is not nullable in field
bigint_col
at
org.apache.beam.sdk.values.RowUtils$RowFieldMatcher.match(RowUtils.java:211)
```
--
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]