Skip to content

Commit

Permalink
Filters Fixing the seekTo parameter when all the partitions are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgrdich committed Dec 30, 2022
1 parent 9fad0d0 commit 9089043
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,21 @@ const Filters: React.FC<FiltersProps> = ({
props.seekType = SeekType.TIMESTAMP;
}

props.seekTo = selectedPartitions.map(({ value }) => {
const offsetProperty =
seekDirection === SeekDirection.FORWARD ? 'offsetMin' : 'offsetMax';
const offsetBasedSeekTo =
currentOffset || partitionMap[value][offsetProperty];
const seekToOffset =
currentSeekType === SeekType.OFFSET
? offsetBasedSeekTo
: timestamp?.getTime();

return `${value}::${seekToOffset || '0'}`;
});
if (selectedPartitions.length !== partitions.length) {
// not everything in the partition is selected
props.seekTo = selectedPartitions.map(({ value }) => {
const offsetProperty =
seekDirection === SeekDirection.FORWARD ? 'offsetMin' : 'offsetMax';
const offsetBasedSeekTo =
currentOffset || partitionMap[value][offsetProperty];
const seekToOffset =
currentSeekType === SeekType.OFFSET
? offsetBasedSeekTo
: timestamp?.getTime();

return `${value}::${seekToOffset || '0'}`;
});
}
}

const newProps = omitBy(props, (v) => v === undefined || v === '');
Expand Down

0 comments on commit 9089043

Please sign in to comment.