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

   ### 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
   
   mongodb原表中一行数据有字段为null(已经给这个字段声明了数据类型-BYTES),直接异常,但是其它行数据这个字段是有值的。
   
   ### SeaTunnel Version
   
   2.3.3
   
   ### SeaTunnel Config
   
   ```conf
   {
     "env":{
       "execution.parallelism":"3",
       "job.mode":"STREAMING",
       "checkpoint.interval":"5000"
     },
     "source":[
       {
         "schema":{
           "fields":{
             "_id":"STRING",
             "pk":"BIGINT",
             "id":"BIGINT",
             "idStr":"STRING",
             "name":"STRING",
             "passwd":"STRING",
             "sfz":"STRING",
             "phone":"STRING",
             "bankCard":"STRING",
             "address":"STRING",
             "zipcode":"INT",
             "company":"STRING",
             "email":"STRING",
             "lat":"STRING",
             "lng":"STRING",
             "imageUrl":"STRING",
             "files":"BYTES",
             "COMMIT":"STRING",
             "年龄":"STRING",
             "text":"STRING",
             "select":"STRING"
           }
         },
         "database":[
           "cdc"
         ],
         "password":"******",
         "startup.mode":"INITIAL",
         "connection.options":"authSource=cdc",
         "hosts":"172.16.8.205:37017,172.16.8.205:37018,172.16.8.205:37019",
         "result_table_name":"mongo_cdc_demo_sink",
         "collection":[
           "cdc.mongo_cdc_demo_source"
         ],
         "plugin_name":"MongoDB-CDC",
         "username":"******"
       }
     ],
     "transform":[
   
     ],
     "sink":[
       {
         "batch_size":10000,
         "primary_keys":[
           "_id"
         ],
         "source_table_name":"mongo_cdc_demo_sink",
         "plugin_name":"jdbc",
         
"url":"jdbc:mysql://172.16.11.131:3306/mysql_test?remarks=true&useInformationSchema=true&useCursorFetch=true&defaultFetchSize=2048&rewriteBatchedStatements=true",
         "password":"******",
         "database":"mysql_test",
         "enable_upsert":true,
         "driver":"com.mysql.cj.jdbc.Driver",
         "generate_sink_sql":true,
         "user":"******",
         "table":"mongo_cdc_demo_sink",
         "batch_interval_ms":1000
       }
     ]
   }
   ```
   
   
   ### Running Command
   
   ```shell
   bin/seatunnel.sh -c job.json
   ```
   
   
   ### Error Exception
   
   ```log
   Caused by: 
org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException: 
org.apache.seatunnel.connectors.seatunnel.cdc.mongodb.exception.MongodbConnectorException:
 ErrorCode:[COMMON-05], ErrorDescription:[Unsupported operation] - Unable to 
convert to <BYTES> from nullable value BsonNull
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   1.8
   
   ### Screenshots
   
   
![bc2a257d337b67991829784cfb39d9e](https://github.com/apache/seatunnel/assets/90698333/1f36ee3b-d659-4209-865e-944e081b1339)
   
![image](https://github.com/apache/seatunnel/assets/90698333/e994e543-7c1d-41c8-94ec-b08511e18c63)
   
   
   ### Are you willing to submit PR?
   
   - [X] 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