Skip to content

Commit

Permalink
Fix arg order on iceberg bucket transforms
Browse files Browse the repository at this point in the history
Position and count seemed to be swapped accidentally in some cases
  • Loading branch information
ZacBlanco committed Dec 31, 2024
1 parent 475167c commit 455c3bf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private static Block bucketInteger(Block block, int count)

private static int bucketValueInteger(Block block, int position, int count)
{
return bucketValue(block, count, position, pos -> bucketHash(INTEGER.getLong(block, pos)));
return bucketValue(block, position, count, pos -> bucketHash(INTEGER.getLong(block, pos)));
}

private static Block bucketBigint(Block block, int count)
Expand All @@ -259,7 +259,7 @@ private static Block bucketBigint(Block block, int count)

private static int bucketValueBigint(Block block, int position, int count)
{
return bucketValue(block, count, position, pos -> bucketHash(BIGINT.getLong(block, pos)));
return bucketValue(block, position, count, pos -> bucketHash(BIGINT.getLong(block, pos)));
}

private static Block bucketShortDecimal(DecimalType decimal, Block block, int count)
Expand All @@ -273,7 +273,7 @@ private static Block bucketShortDecimal(DecimalType decimal, Block block, int co

private static int bucketValueShortDecimal(DecimalType decimal, Block block, int position, int count)
{
return bucketValue(block, count, position, pos -> {
return bucketValue(block, position, count, pos -> {
// TODO: write optimized implementation
BigDecimal value = readBigDecimal(decimal, block, pos);
return bucketHash(Slices.wrappedBuffer(value.unscaledValue().toByteArray()));
Expand All @@ -291,7 +291,7 @@ private static Block bucketLongDecimal(DecimalType decimal, Block block, int cou

private static int bucketValueLongDecimal(DecimalType decimal, Block block, int position, int count)
{
return bucketValue(block, count, position, pos -> {
return bucketValue(block, position, count, pos -> {
// TODO: write optimized implementation
BigDecimal value = readBigDecimal(decimal, block, pos);
return bucketHash(Slices.wrappedBuffer(value.unscaledValue().toByteArray()));
Expand Down

0 comments on commit 455c3bf

Please sign in to comment.