Skip to content

Commit 75e0adf

Browse files
author
Marius Posta
authored
bulk-cdk-toolkit-extract-jdbc: remove cursor from WHERE clause in initial syncs (#44011)
1 parent 42c9bc1 commit 75e0adf

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

airbyte-cdk/bulk/toolkits/extract-jdbc/src/main/kotlin/io/airbyte/cdk/read/StreamPartitionReader.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ fun StreamPartitionReader.Input.querySpec(
185185
checkpointUpperBound = primaryKeyUpperBound,
186186
isOrdered,
187187
limit,
188-
extraConjWhereClauses = arrayOf(LesserOrEqual(cursor, cursorUpperBound)),
189188
)
190189
is StreamPartitionReader.CursorIncrementalInput ->
191190
querySpecForStreamPartitionReader(
@@ -205,7 +204,6 @@ private fun querySpecForStreamPartitionReader(
205204
checkpointUpperBound: List<JsonNode>?,
206205
isOrdered: Boolean,
207206
limit: Long?,
208-
vararg extraConjWhereClauses: WhereClauseNode,
209207
): SelectQuerySpec {
210208
val selectColumns: List<Field> =
211209
if (isOrdered) {
@@ -240,11 +238,10 @@ private fun querySpecForStreamPartitionReader(
240238
} + listOf(lastLeaf),
241239
)
242240
}
243-
val whereClause = And(listOf(Or(lowerBoundDisj), Or(upperBoundDisj)) + extraConjWhereClauses)
244241
return SelectQuerySpec(
245242
SelectColumns(selectColumns),
246243
From(stream.name, stream.namespace),
247-
Where(whereClause),
244+
Where(And(Or(lowerBoundDisj), Or(upperBoundDisj))),
248245
if (isOrdered) OrderBy(checkpointColumns) else NoOrderBy,
249246
if (limit == null) NoLimit else Limit(limit),
250247
)

0 commit comments

Comments
 (0)