Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,12 @@ private void startInBatchMode() {
p.getPartitionId(),
p.getPartitionName()))
.collect(Collectors.toList());
splits = this.initPartitionedSplits(partitions);
// Use log-only splits to avoid generating mixed split
// types (HybridSnapshotLogSplit + LogSplit) for
// primary-key tables, which is not supported.
splits = this.initLogTablePartitionSplits(partitions);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note it'll just genereate log split without stopping offset which will then nerver stop..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matrixsparse Good catch! Updated getLogSplit() to use stoppingOffsetsInitializer.getBucketOffsets() and pass the stopping offset to the 4-parameter LogSplit constructor. PTAL.

} else {
splits = this.initNonPartitionedSplits();
splits = this.getLogSplit(null, null);
}
}
return splits;
Expand Down Expand Up @@ -734,18 +737,21 @@ private List<SourceSplitBase> getLogSplit(
}

if (!bucketsNeedInitOffset.isEmpty()) {
startingOffsetsInitializer
.getBucketOffsets(partitionName, bucketsNeedInitOffset, bucketOffsetsRetriever)
.forEach(
(bucketId, startingOffset) ->
splits.add(
new LogSplit(
new TableBucket(
tableInfo.getTableId(),
partitionId,
bucketId),
partitionName,
startingOffset)));
Map<Integer, Long> startingOffsets =
startingOffsetsInitializer.getBucketOffsets(
partitionName, bucketsNeedInitOffset, bucketOffsetsRetriever);
Map<Integer, Long> stoppingOffsets =
stoppingOffsetsInitializer.getBucketOffsets(
partitionName, bucketsNeedInitOffset, bucketOffsetsRetriever);
startingOffsets.forEach(
(bucketId, startingOffset) ->
splits.add(
new LogSplit(
new TableBucket(
tableInfo.getTableId(), partitionId, bucketId),
partitionName,
startingOffset,
stoppingOffsets.get(bucketId))));
}
return splits;
}
Expand Down