Fix bug with getStateEmissionFrequency() settings (#26974)
An order by query should NOT be issued when the connector does not emit intermediate state
This commit is contained in:
@@ -110,9 +110,9 @@ public abstract class AbstractJdbcSource<Datatype> extends AbstractDbSource<Data
|
||||
final SyncMode syncMode,
|
||||
final Optional<String> cursorField) {
|
||||
LOGGER.info("Queueing query for table: {}", tableName);
|
||||
// This corresponds to the initial sync for in INCREMENTAL_MODE. The ordering of the records matters
|
||||
// as intermediate state messages are emitted.
|
||||
if (syncMode.equals(SyncMode.INCREMENTAL)) {
|
||||
// This corresponds to the initial sync for in INCREMENTAL_MODE, where the ordering of the records matters
|
||||
// as intermediate state messages are emitted (if the connector emits intermediate state).
|
||||
if (syncMode.equals(SyncMode.INCREMENTAL) && getStateEmissionFrequency() > 0) {
|
||||
final String quotedCursorField = enquoteIdentifier(cursorField.get(), getQuoteString());
|
||||
return queryTable(database, String.format("SELECT %s FROM %s ORDER BY %s ASC",
|
||||
enquoteIdentifierList(columnNames, getQuoteString()),
|
||||
|
||||
Reference in New Issue
Block a user