matianhe3 opened a new issue, #4992:
URL: https://github.com/apache/seatunnel/issues/4992

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   Sqlserver to Redis transform failed to parse json.
   
   when i don't use transform , sink redis, clickhouse  it works.
   
   when i use transform , sink clickhouse it works.
   
   but when i use transform, sink redis  it show json parse failed.
   
   ### SeaTunnel Version
   
   2.3.2
   
   ### SeaTunnel Config
   
   ```conf
   env {
     execution.parallelism = 3
     job.mode = "BATCH"
     checkpoint.interval = 10000
   }
   
   source {
     Jdbc {
       result_table_name = source
       url = "jdbc:sqlserver://"
       driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
       connection_check_timeout_sec = 100
       user = 
       password = 
       query = "select top 10 id, labelid, classificationrelevantid, creatorid, 
creatorname, createtime, updaterid, updatername, updatetime, labeltype, 
weightscore from wbird_maindb.dbo.wbird_label_tag where updatetime is not null"
     }
   }
   
   transform {
     Replace {
       source_table_name = [source]
       result_table_name = final
       replace_field = labelid
       pattern = "\\d+"
       replacement = 111
       is_regex = true
       replace_first = false
     }
   }
   
   sink {
     Redis {
       source_table_name = [final]
       host = 
       port = 
       key = test
       mode = cluster
       data_type = list
     }
     Clickhouse {
       source_table_name = [final]
       host = 
       database = 
       table = 
       username = 
       password = 
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   seatunnel.sh --config xxx.conf
   
   > cluster mode
   ```
   
   
   ### Error Exception
   
   ```log
   Caused by: 
org.apache.seatunnel.format.json.exception.SeaTunnelJsonFormatException: 
ErrorCode:[COMMON-02], ErrorDescription:[Json covert/parse operation failed] - 
Failed to deserialize JSON 'SeaTunnelRow{tableId=, kind=+I, fields=[789248, 
111, 299860, 0, [系统脚本]初期批量导入, 2022-06-14T14:33:27.530, 405, 新月, 
2023-01-06T13:46:12.143, 0, null]}'.
        at 
org.apache.seatunnel.format.json.JsonSerializationSchema.serialize(JsonSerializationSchema.java:64)
        at 
org.apache.seatunnel.connectors.seatunnel.redis.sink.RedisSinkWriter.write(RedisSinkWriter.java:52)
        at 
org.apache.seatunnel.connectors.seatunnel.redis.sink.RedisSinkWriter.write(RedisSinkWriter.java:35)
        at 
org.apache.seatunnel.engine.server.task.flow.SinkFlowLifeCycle.received(SinkFlowLifeCycle.java:202)
        ... 15 more
   Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to 
java.lang.Integer
        at 
org.apache.seatunnel.format.json.RowToJsonConverters$6.convert(RowToJsonConverters.java:105)
        at 
org.apache.seatunnel.format.json.RowToJsonConverters$1.convert(RowToJsonConverters.java:63)
        at 
org.apache.seatunnel.format.json.RowToJsonConverters$18.convert(RowToJsonConverters.java:223)
        at 
org.apache.seatunnel.format.json.RowToJsonConverters$1.convert(RowToJsonConverters.java:63)
        at 
org.apache.seatunnel.format.json.JsonSerializationSchema.serialize(JsonSerializationSchema.java
   ```
   
   
   ### Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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