@Test
    public void testUnHexFunction() throws Exception {
        String transformSql = null, data = null;
        TransformConfig config = null;
        TransformProcessor<String, String> processor = null;
        List<String> output = null;

        transformSql = "select unhex(string1) from source";
        config = new TransformConfig(transformSql);
        processor = TransformProcessor
                .create(config, SourceDecoderFactory.createCsvDecoder(csvSource),
                        SinkEncoderFactory.createKvEncoder(kvSink));
        // case3: unhex("6")
        output = processor.transform("6", new HashMap<>());
        Assert.assertEquals(1, output.size());
        Assert.assertEquals("result=", output.get(0));
        // case1: unhex("696E6C6F6E67")
        output = processor.transform("696E6C6F6E67", new HashMap<>());
        Assert.assertEquals(1, output.size());
        Assert.assertEquals("result=inlong", output.get(0));

        // case2: unhex("")
        output = processor.transform("|", new HashMap<>());
        Assert.assertEquals(1, output.size());
        Assert.assertEquals(output.get(0), "result=");

        // case3: unhex("6")
        output = processor.transform("6", new HashMap<>());
        Assert.assertEquals(1, output.size());
        Assert.assertEquals("result=", output.get(0));

        transformSql = "select unhex(hex(string1)) from source";
        config = new TransformConfig(transformSql);
        processor = TransformProcessor
                .create(config, SourceDecoderFactory.createCsvDecoder(csvSource),
                        SinkEncoderFactory.createKvEncoder(kvSink));
        // case4: unhex(hex("inlong"))
        output = processor.transform("inlong", new HashMap<>());
        Assert.assertEquals(1, output.size());
        Assert.assertEquals("result=inlong", output.get(0));

    }
TestUnHexFunction
description: test the unhex function in transform processor
inlong-sdk/transform-sdk/src/test/java/org/apache/inlong/sdk/transform/process/function/string/TestUnHexFunction.java