aloyszhang commented on code in PR #10155: URL: https://github.com/apache/inlong/pull/10155#discussion_r1593900789
########## inlong-sdk/transform-sdk/src/test/java/org/apache/inlong/sdk/transform/process/TestTransformProcessor.java: ########## @@ -100,6 +122,28 @@ public void testKv2Csv() { } } + @Test + public void testKv2CsvNoField() { + try { + SourceInfo kvSource = new KvSourceInfo("UTF-8", null); + SinkInfo csvSink = new CsvSinkInfo("UTF-8", "|", "\\", null); + String transformSql = "select ftime,extinfo from source where extinfo='ok'"; + TransformConfig config = new TransformConfig(kvSource, csvSink, transformSql); + // case1 + TransformProcessor processor1 = new TransformProcessor(config); + List<String> output1 = processor1.transform("ftime=2024-04-28 00:00:00&extinfo=ok", new HashMap<>()); + Assert.assertTrue(output1.size() == 1); + Assert.assertEquals(output1.get(0), "2024-04-28 00:00:00|ok"); + // case2 + config.setTransformSql("select ftime,extinfo from source where extinfo!='ok'"); + TransformProcessor processor2 = new TransformProcessor(config); + List<String> output2 = processor2.transform("ftime=2024-04-28 00:00:00&extinfo=ok", new HashMap<>()); + Assert.assertTrue(output2.size() == 0); + } catch (Exception e) { + e.printStackTrace(); + } Review Comment: ditto here. I saw other tests have the same problem also, plz fix them(in this pull request or a new pull request) -- 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: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org