Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
daria-malkova committed Jun 28, 2021
1 parent cc5bd0d commit 76c37fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,11 @@ public void populateDisplayData(DisplayData.Builder builder) {
super.populateDisplayData(builder);
builder.add(DisplayData.item("rowMapper", getRowMapper().getClass().getName()));
builder.add(DisplayData.item("coder", getCoder().getClass().getName()));
builder.add(DisplayData.item("partitionColumn", getPartitionColumn()));
builder.add(DisplayData.item("table", getTable()));
builder.add(DisplayData.item("numPartitions", getNumPartitions()));
builder.add(DisplayData.item("lowerBound", getLowerBound()));
builder.add(DisplayData.item("upperBound", getUpperBound()));
if (getDataSourceProviderFn() instanceof HasDisplayData) {
((HasDisplayData) getDataSourceProviderFn()).populateDisplayData(builder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ public void processElement(ProcessContext c) {
Integer lowerBound = params.get(0);
Integer upperBound = params.get(1);
Integer numPartitions = params.get(2);
if (lowerBound > upperBound) {
throw new RuntimeException(
String.format(
"Lower bound [%s] is higher than upper bound [%s]", lowerBound, upperBound));
}
int stride = (upperBound - lowerBound) / numPartitions + 1;
for (int i = lowerBound; i < upperBound - stride; i += stride) {
String range = String.format("%s,%s", i, i + stride);
Expand Down

0 comments on commit 76c37fc

Please sign in to comment.