github-code-scanning[bot] commented on code in PR #15127:
URL: https://github.com/apache/druid/pull/15127#discussion_r1353981050
##########
processing/src/test/java/org/apache/druid/segment/transform/TransformerTest.java:
##########
@@ -444,4 +448,71 @@
Assert.assertEquals(Arrays.asList("1.2", "2.3", "null", "3.4"),
actual.getDimension("dim"));
Assert.assertEquals(row.getTimestamp(), actual.getTimestamp());
}
+
+ @Test
+ public void testTransformWithExpr()
+ {
+ final Transformer transformer = new Transformer(
+ new TransformSpec(
+ null,
+ ImmutableList.of(new ExpressionTransform("dim", "array_slice(dim,
0, 5)", TestExprMacroTable.INSTANCE))
+ )
+ );
+ final List<String> dimList = ImmutableList.of("a", "b", "c", "d", "e",
"f", "g");
+ final MapBasedRow row = new MapBasedRow(
+ DateTimes.nowUtc(),
+ ImmutableMap.of("dim", dimList)
+ );
+ Assert.assertEquals(row.getDimension("dim"), dimList);
+ Assert.assertEquals(row.getRaw("dim"), dimList);
+
+ final InputRow actualTranformedRow = transformer.transform(new InputRow()
Review Comment:
## Inconsistent compareTo
This class declares [compareTo](1) but inherits equals; the two could be
inconsistent.
[Show more
details](https://github.com/apache/druid/security/code-scanning/5885)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]