vitaly-ivanov commented on a change in pull request #15987:
URL: https://github.com/apache/beam/pull/15987#discussion_r753689200
##########
File path:
sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcIOTest.java
##########
@@ -309,6 +310,40 @@ public void testReadRowsWithNumericFields() {
pipeline.run();
}
+ @Test
+ public void testReadRowsWithNumericFieldsWithExcessPrecision() {
+ PCollection<Row> rows =
+ pipeline.apply(
+ JdbcIO.readRows()
+ .withDataSourceConfiguration(DATA_SOURCE_CONFIGURATION)
+ .withQuery(
+ String.format(
+ "SELECT CAST(1 AS NUMERIC(10, 2)) AS T1 FROM %s WHERE
name = ?",
+ READ_TABLE_NAME))
+ .withStatementPreparator(
+ preparedStatement ->
+ preparedStatement.setString(1,
TestRow.getNameForSeed(1))));
+
+ Schema expectedSchema =
+ Schema.of(
+ Schema.Field.of(
+ "T1",
+
FieldType.logicalType(FixedPrecisionNumeric.of(NUMERIC.getName(), 10, 2))
Review comment:
It checks the case where we have a column with excess precision (10) and
a value with a smaller precision (3). Perhaps the name of the test is a bit
confusing.
--
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]