Skip to content

Commit ebcf38e

Browse files
fix: changes
1 parent 8993322 commit ebcf38e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/db2/internal/backfill.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (d *DB2) splitTableIntoChunks(ctx context.Context, stream types.StreamInter
121121
return nil, fmt.Errorf("failed to get table extremes: %s", err)
122122
}
123123
if minVal == nil {
124-
return nil, nil
124+
return types.NewSet[types.Chunk](), nil
125125
}
126126

127127
chunks.Insert(types.Chunk{
@@ -193,6 +193,7 @@ func (d *DB2) splitTableIntoChunks(ctx context.Context, stream types.StreamInter
193193
totalRidRange := maxRID - minRID
194194
// distance between start and end RID of a chunk
195195
ridInterval := int64(math.Ceil(float64(totalRidRange) / float64(numberOfChunks)))
196+
ridInterval = utils.Ternary(ridInterval <= 0, int64(1), ridInterval).(int64)
196197
chunks := types.NewSet[types.Chunk]()
197198
for start := minRID; start <= maxRID; start += ridInterval {
198199
end := start + ridInterval

0 commit comments

Comments
 (0)