Skip to content

Commit 3131abd

Browse files
author
Marius Posta
committed
extract-jdbc: better handling of NULL cursor values
1 parent 6c36470 commit 3131abd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package io.airbyte.cdk.read
44
import com.fasterxml.jackson.core.JsonGenerator
55
import com.fasterxml.jackson.databind.JsonNode
66
import com.fasterxml.jackson.databind.node.ObjectNode
7-
import io.airbyte.cdk.ConfigErrorException
87
import io.airbyte.cdk.discover.Field
98
import io.airbyte.cdk.util.Jsons
109
import io.github.oshai.kotlinlogging.KotlinLogging
@@ -105,7 +104,9 @@ class StreamPartitionsCreatorUtils(
105104
ctx.selectQuerier.executeQuery(q).use { if (it.hasNext()) it.next() else return null }
106105
val value: JsonNode = record[cursor.id] ?: Jsons.nullNode()
107106
if (value.isNull) {
108-
throw ConfigErrorException("NULL value found for cursor ${cursor.id}")
107+
// Either the table is empty, or its cursor column values are all NULL.
108+
// In both cases, there is nothing to be done.
109+
return null
109110
}
110111
return ctx.transientCursorUpperBoundState.update { value }
111112
}

0 commit comments

Comments
 (0)