Skip to content

Commit

Permalink
[cdc-connector][postgres] apply DBZ-5470 to fix lose precision in Pos…
Browse files Browse the repository at this point in the history
…tgresParallelSource
  • Loading branch information
wuzhenhua01 committed Feb 5, 2024
1 parent 167bb40 commit 170e442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,8 @@ private void createDataEventsForTable(

while (rs.next()) {
rows++;
final Object[] row = new Object[columnArray.getGreatestColumnPosition()];
for (int i = 0; i < columnArray.getColumns().length; i++) {
row[columnArray.getColumns()[i].position() - 1] = rs.getObject(i + 1);
}
final Object[] row = jdbcConnection.rowToArray(table, null, rs, columnArray);

if (logTimer.expired()) {
long stop = clock.currentTimeInMillis();
LOG.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import io.debezium.config.Configuration;
import io.debezium.connector.postgresql.PgOid;
import io.debezium.connector.postgresql.PostgresConnectorConfig;
import io.debezium.connector.postgresql.PostgresSchema;
import io.debezium.connector.postgresql.PostgresType;
import io.debezium.connector.postgresql.PostgresValueConverter;
import io.debezium.connector.postgresql.TypeRegistry;
Expand Down Expand Up @@ -767,8 +766,7 @@ public <T extends DatabaseSchema<TableId>> Object getColumnValue(
try {
final ResultSetMetaData metaData = rs.getMetaData();
final String columnTypeName = metaData.getColumnTypeName(columnIndex);
final PostgresType type =
((PostgresSchema) schema).getTypeRegistry().get(columnTypeName);
final PostgresType type = getTypeRegistry().get(columnTypeName);

LOGGER.trace("Type of incoming data is: {}", type.getOid());
LOGGER.trace("ColumnTypeName is: {}", columnTypeName);
Expand Down

0 comments on commit 170e442

Please sign in to comment.