This is an automated email from the ASF dual-hosted git repository.
wanghailin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new c25beb9f8a [Improve][Postgres-CDC] Update jdbc fetchsize (#6245)
c25beb9f8a is described below
commit c25beb9f8a70e2d092066deec29b283345e717ba
Author: hailin0 <[email protected]>
AuthorDate: Thu Jan 18 21:45:20 2024 +0800
[Improve][Postgres-CDC] Update jdbc fetchsize (#6245)
---
.../connectors/seatunnel/cdc/postgres/utils/PostgresUtils.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/PostgresUtils.java
b/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/PostgresUtils.java
index ab26feddf5..b83e287540 100644
---
a/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/PostgresUtils.java
+++
b/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/PostgresUtils.java
@@ -50,6 +50,8 @@ import java.util.Optional;
/** The utils for SqlServer data source. */
@Slf4j
public class PostgresUtils {
+ private static final int DEFAULT_FETCH_SIZE = 1024;
+
private PostgresUtils() {}
public static Object[] queryMinMax(JdbcConnection jdbc, TableId tableId,
String columnName)
@@ -154,7 +156,7 @@ public class PostgresUtils {
.createStatement(
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY);
- stmt.setFetchSize(Integer.MIN_VALUE);
+ stmt.setFetchSize(DEFAULT_FETCH_SIZE);
rs = stmt.executeQuery(sampleQuery);
int count = 0;