Skip to content

Commit c25beb9

Browse files
authored
[Improve][Postgres-CDC] Update jdbc fetchsize (#6245)
1 parent d18b0c8 commit c25beb9

File tree

1 file changed

+3
-1
lines changed
  • seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils

1 file changed

+3
-1
lines changed

seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/PostgresUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
/** The utils for SqlServer data source. */
5151
@Slf4j
5252
public class PostgresUtils {
53+
private static final int DEFAULT_FETCH_SIZE = 1024;
54+
5355
private PostgresUtils() {}
5456

5557
public static Object[] queryMinMax(JdbcConnection jdbc, TableId tableId, String columnName)
@@ -154,7 +156,7 @@ public static Object[] skipReadAndSortSampleData(
154156
.createStatement(
155157
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
156158

157-
stmt.setFetchSize(Integer.MIN_VALUE);
159+
stmt.setFetchSize(DEFAULT_FETCH_SIZE);
158160
rs = stmt.executeQuery(sampleQuery);
159161

160162
int count = 0;

0 commit comments

Comments
 (0)