uniorder opened a new issue, #16962:
URL: https://github.com/apache/doris/issues/16962

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   5.7.37
   
   ### What's Wrong?
   
   目前我们有一千多张表,几乎所有的表都可以通过以下代码插入数据:
   
   ```java
   try (PreparedStatement statement = connection.prepareStatement(sql)) {
       for (InsertRecord insertRecord : insertRecords) {
           int i = 1;
           for (Map.Entry<String, Object> entry : 
insertRecord.getRow().entrySet()) {
               statement.setObject(i, entry.getValue());
               i++;
           }
           statement.addBatch();
       }
       statement.executeBatch();
       statement.clearBatch();
   } catch (SQLException e) {
       e.printStackTrace();
   }
   ```
   
   但其中一张表就是无法插入,Doris也不报任何错误,该表的DDL如下所示:
   
   ```sql
   CREATE TABLE HEXT3 (
     `_datahub_row_id` VARCHAR ( 200 ) NOT NULL COMMENT '自定义主键',
     `REC_CREATOR` VARCHAR ( 32 ) NOT NULL,
     `REC_CREATE_TIME` VARCHAR ( 14 ) NOT NULL,
     `REC_REVISOR` VARCHAR ( 32 ) NOT NULL,
     `REC_REVISE_TIME` VARCHAR ( 14 ) NOT NULL,
     `ARCHIVE_FLAG` CHAR NOT NULL,
     `TC_ID` DECIMAL ( 27, 9 ) NOT NULL,
     `TC_NO` VARCHAR ( 20 ) NOT NULL,
     `TC_SEQ_NO` DECIMAL ( 27, 9 ) NOT NULL,
     `TC_TIME` VARCHAR ( 20 ) NOT NULL,
     `TC_DATA` string,
     `TC_DATA_HEAD` VARCHAR ( 4000 ) NOT NULL,
     `PROCESS_CODE` DECIMAL ( 27, 9 ) NOT NULL,
     `PROCESS_MESSAGE` VARCHAR ( 250 ) NOT NULL,
     `TC_TYPE` CHAR NOT NULL,
     `TC_REMARK` string,
     `KEY_VALUE_1` VARCHAR ( 100 ) NOT NULL,
     `KEY_VALUE_2` VARCHAR ( 100 ) NOT NULL,
     `KEY_VALUE_3` VARCHAR ( 100 ) NOT NULL,
     `KEY_VALUE_4` VARCHAR ( 100 ) NOT NULL,
   `KEY_VALUE_5` VARCHAR ( 100 ) NOT NULL 
   ) UNIQUE KEY ( `_datahub_row_id` ) DISTRIBUTED BY HASH ( `_datahub_row_id` ) 
BUCKETS 1 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" );
   ```
   
   但是将生成的SQL用Navicat执行,是可以插入数据的。
   
   ### What You Expected?
   
   请问是因为批量插入的问题吗?
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _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...@doris.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to