From 455c3bf7a3209552befbe0ce883b8689ced182f5 Mon Sep 17 00:00:00 2001 From: Zac Blanco Date: Tue, 31 Dec 2024 12:09:22 -0500 Subject: [PATCH] Fix arg order on iceberg bucket transforms Position and count seemed to be swapped accidentally in some cases --- .../com/facebook/presto/iceberg/PartitionTransforms.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java index 5c6dacc40c95c..13848b7ad082f 100644 --- a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java +++ b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java @@ -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) @@ -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) @@ -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())); @@ -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()));