aloyszhang commented on code in PR #10615:
URL: https://github.com/apache/inlong/pull/10615#discussion_r1675491059


##########
inlong-sdk/transform-sdk/src/test/java/org/apache/inlong/sdk/transform/process/TestTransformArithmeticFunctionsProcessor.java:
##########
@@ -117,4 +117,72 @@ public void testLnFunction() throws Exception {
         Assert.assertTrue(output2.size() == 1);
         Assert.assertEquals(output2.get(0), "result=2.302585092994046");
     }
+
+    @Test
+    public void testLog10Function() throws Exception {
+        String transformSql = "select log10(numeric1) from source";
+        TransformConfig config = new TransformConfig(csvSource, kvSink, 
transformSql);
+        // case1: log10(1)
+        TransformProcessor processor = new TransformProcessor(config);
+        List<String> output1 = processor.transform("1|4|6|8", new HashMap<>());
+        Assert.assertTrue(output1.size() == 1);
+        Assert.assertEquals(output1.get(0), "result=0.0");
+        // case2: log10(1000)
+        List<String> output2 = processor.transform("1000|4|6|8", new 
HashMap<>());
+        Assert.assertTrue(output2.size() == 1);

Review Comment:
   ```suggestion
            Assert.assertEquals(1, output1.size());
           Assert.assertEquals(output1.get(0), "result=0.0");
           // case2: log10(1000)
           List<String> output2 = processor.transform("1000|4|6|8", new 
HashMap<>());
           Assert.assertEquals(1, output2.size());
   ```



-- 
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]

Reply via email to