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

   ### 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
   
   生成json格式的本地文件时数字被转为科学计数法。
   When generating a local file in JSON format, numbers are converted to 
scientific notation.
   
   
数据库中的字段fe_result,类型为decimal(10,2),source使用jdbc,sink使用LocalFile,格式指定为json,导出的json文件中的数字变更了科学技术法的表示方式。
   When exporting data from a database, the field `fe_result` with a type of 
`DECIMAL(10,2)` is being converted to scientific notation in the exported JSON 
file. This issue occurs when using JDBC as the source and LocalFile as the 
sink, with the JSON format specified for the output.
   
   数据表结构如下:
   The table DDL SQL:
   `CREATE TABLE `data_collection` (
     `id` int(11)  NOT NULL COMMENT '主键id',
     `code` varchar(50) NOT NULL COMMENT '编号',
     `fe_result` decimal(10,2) DEFAULT NULL COMMENT '记录值',
     PRIMARY KEY (`id`) USING BTREE
   ) ENGINE=InnoDB COMMENT='数据';`
   
   
   数据库中的数据:
   data in DB-table:
   id:12312;code:1001015;fe_result:80.00
   
   JSON结果文件:
   JSON file:
   {"id":12312,"code":"1001015","fe_result":8E+1}
   
   ### SeaTunnel Version
   
   2.3.9
   
   ### SeaTunnel Config
   
   ```conf
   env {
     job.mode = "BATCH"  # 离线批处理模式
   }
   
   source {
     Jdbc{
       parallelism=1
       plugin_output = "data_1"
       url = 
"jdbc:mysql://ip:p/data_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"
       user = ""
       password = ""
       driver = "com.mysql.cj.jdbc.Driver"
       query = "select id, code, fe_result from data_collection"
     }
   
   }
   
   sink {
       LocalFile {
           plugin_input = "data_1"
           path = "../files/json"
           file_format_type = "json"
       }
   }
   ```
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh --config config/mysql2file_json_for_2.3.9.config -m local
   ```
   
   ### Error Exception
   
   ```log
   no exception.
   ```
   
   ### Zeta or Flink or Spark Version
   
   Zeta by seatunnel-2.3.9
   
   ### Java or Scala Version
   
   JDK 23.
   
   ### 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: commits-unsubscr...@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to