hustxjs commented on issue #5059:
URL: https://github.com/apache/seatunnel/issues/5059#issuecomment-1657919356

   here is java code:
   ```java
   @AutoService(ZetaUDF.class)
   public class qdmxUDF implements ZetaUDF {
   
       @Override
       public String functionName() {
           return "qdmx";
       }
   
       @Override
       public SeaTunnelDataType<?> resultType(List<SeaTunnelDataType<?>> list) {
           return BasicType.STRING_TYPE;
       }
   
       @Override
       public Object evaluate(List<Object> list) {
           String str = list.get(0).toString();
           return "b:"+list.get(0).toString();
       }
   
   }
   ```
   
   and config is :
   ```xml
   env {
     execution.parallelism = 1
     job.mode = "BATCH"
   }
   
   source {
     Clickhouse {
       host = "192.168.9.103:8123"
       database = "default"
       username = "root"
       password = "1234567"
        sql = "select id, name from default.tt1 "
       result_table_name = "fake"
     }
     
   }
   
   
   transform {
       source_table_name = "fake"
       result_table_name = "fake1"
      udf {
           function.example = "com.dscomm.web.qdmxUDF"
       }
       
     Sql {
       
       query = "select id, qdmx(name) as name2  from fake"
     }
   }
   
   sink {
     Console {
       source_table_name = "fake1"
     }
   
   }
   ```
   
   @liunaijie 


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