From d389967175c42c5673180d439fc1263fbd3df3fc Mon Sep 17 00:00:00 2001 From: Pranav Bhole Date: Thu, 12 Oct 2023 13:44:49 -0700 Subject: [PATCH] Addressing comments --- .../apache/druid/segment/transform/ExpressionTransform.java | 6 +----- .../org/apache/druid/segment/transform/TransformerTest.java | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/processing/src/main/java/org/apache/druid/segment/transform/ExpressionTransform.java b/processing/src/main/java/org/apache/druid/segment/transform/ExpressionTransform.java index da84e8a992e4c..98d2e54cb8c24 100644 --- a/processing/src/main/java/org/apache/druid/segment/transform/ExpressionTransform.java +++ b/processing/src/main/java/org/apache/druid/segment/transform/ExpressionTransform.java @@ -100,11 +100,7 @@ static class ExpressionRowFunction implements RowFunction public Object eval(final Row row) { try { - Object result = expr.eval(InputBindings.forRow(row)).valueOrDefault(); - if (result != null && result.getClass().isArray()) { - return Rows.objectToStrings(result); - } - return result; + return expr.eval(InputBindings.forRow(row)).valueOrDefault(); } catch (Throwable t) { throw new ISE(t, "Could not transform value for %s reason: %s", name, t.getMessage()); diff --git a/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java b/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java index 012a048735e34..e4a82f9696f82 100644 --- a/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java +++ b/processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java @@ -513,6 +513,6 @@ public int compareTo(Row o) } }); Assert.assertEquals(actualTranformedRow.getDimension("dim"), dimList.subList(0, 5)); - Assert.assertEquals(actualTranformedRow.getRaw("dim"), dimList.subList(0, 5)); + Assert.assertArrayEquals(dimList.subList(0, 5).toArray(), (Object[]) actualTranformedRow.getRaw("dim")); } }