File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
toolkits/extract-jdbc/src/main/kotlin/io/airbyte/cdk/read Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change
1
+ ## Version 0.1.41
2
+
3
+ ** Extract CDK**
4
+
5
+ * ** Changed:** Prevent a devision by zero error when a table cannot be partitioned.
6
+
1
7
## Version 0.1.40
2
8
3
9
Add gradle task to bump CDK version + add changelog entry
Original file line number Diff line number Diff line change @@ -253,6 +253,14 @@ class JdbcConcurrentPartitionsCreator<
253
253
.filter { random.nextDouble() < secondarySamplingRate }
254
254
.mapNotNull { (splitBoundary: OpaqueStateValue ? , _) -> splitBoundary }
255
255
.distinct()
256
+
257
+ // Handle edge case with empty split boundaries when sampling rate is too low,
258
+ // causing random filtering to discard all sampled boundaries, which would
259
+ // lead to division by zero the in the split() function. Fall back to single partition.
260
+ if (splitBoundaries.isEmpty()) {
261
+ log.warn { " No split boundaries found, using single partition" }
262
+ return listOf (JdbcNonResumablePartitionReader (partition))
263
+ }
256
264
val partitions: List <JdbcPartition <* >> = partitionFactory.split(partition, splitBoundaries)
257
265
log.info { " Table will be read by ${partitions.size} concurrent partition reader(s)." }
258
266
return partitions.map { JdbcNonResumablePartitionReader (it) }
Original file line number Diff line number Diff line change 1
- version =0.1.40
1
+ version =0.1.41
You can’t perform that action at this time.
0 commit comments