Skip to content

Commit

Permalink
fix: Fix duplicate primary keys in query results
Browse files Browse the repository at this point in the history
  • Loading branch information
zhourui999 committed Apr 7, 2024
1 parent 7e9eed2 commit 275da6e
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ private List<DataSplit> generateSplits(
for (Map.Entry<Integer, List<DataFileMeta>> bucketEntry : buckets.entrySet()) {
int bucket = bucketEntry.getKey();
List<DataFileMeta> bucketFiles = bucketEntry.getValue();
DataSplit.Builder builder =
DataSplit.builder()
.withSnapshot(snapshotId)
.withPartition(partition)
.withBucket(bucket)
.isStreaming(isStreaming);
List<SplitGenerator.SplitGroup> splitGroups =
isStreaming
? splitGenerator.splitForStreaming(bucketFiles)
Expand All @@ -283,17 +289,12 @@ private List<DataSplit> generateSplits(
.orElse(null)
: null;
for (SplitGenerator.SplitGroup splitGroup : splitGroups) {
DataSplit.Builder builder =
DataSplit.builder()
.withSnapshot(snapshotId)
.withPartition(partition)
.withBucket(bucket)
.isStreaming(isStreaming);
List<DataFileMeta> dataFiles = splitGroup.files;
builder.withDataFiles(dataFiles);
if (splitGroup.rawConvertible) {
builder.rawFiles(convertToRawFiles(partition, bucket, dataFiles));
}
builder.rawFiles(
splitGroup.rawConvertible
? convertToRawFiles(partition, bucket, dataFiles)
: Collections.emptyList());
if (deletionVectors) {
builder.withDataDeletionFiles(
getDeletionFiles(dataFiles, deletionIndexFile));
Expand Down

0 comments on commit 275da6e

Please sign in to comment.