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

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   1.1.3-rc02-87ff019
   
   ### What's Wrong?
   
   MySQL [dwd_db]> CREATE TABLE `test1` (
       ->   `a` int(11) NOT NULL COMMENT "",
       ->   `b` text NULL COMMENT ""
       -> ) ENGINE=OLAP
       -> DUPLICATE KEY(`a`)
       -> COMMENT "OLAP"
       -> DISTRIBUTED BY HASH(`a`) BUCKETS 10
       -> PROPERTIES (
       -> "replication_allocation" = "tag.location.default: 1",
       -> "in_memory" = "false",
       -> "storage_format" = "V2"
       -> );
   Query OK, 0 rows affected (0.02 sec)
   
   MySQL [dwd_db]> create table test2 PROPERTIES (
        "replication_allocation" = "tag.location.default: 1",
        "in_memory" = "false",
        "storage_format" = "V2"
       )as select a ,lpad(b,10,'0') as b from test1;
   Query OK, 0 rows affected (0.06 sec)
   {'label':'insert_3ed1d3c23c3b4b79-9e960e4523ee3359', 'status':'VISIBLE', 
'txnId':'8011'}
   
   MySQL [dwd_db]> show create table test2\G
   *************************** 1. row ***************************
          Table: test2
   Create Table: CREATE TABLE `test2` (
     `a` int(11) NOT NULL COMMENT "",
     `b` text NULL COMMENT ""
   ) ENGINE=OLAP
   DUPLICATE KEY(`a`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`a`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2"
   );
   1 row in set (0.00 sec)
   
   MySQL [dwd_db]> insert into test2 values(1,'xxxx');
   Query OK, 0 rows affected, 1 warning (0.03 sec)
   {'label':'insert_21f97816765d4fed-9360b4e94489edd0', 'status':'VISIBLE', 
'txnId':'8012'}
   
   但是查看show 
load,会发现上次插入数据失败了,通过访问对应的http://9.134.167.25:8040/api/_load_error_log?fxxxx
   ```
   Reason: the length of input is too long than schema. column_name: b; input 
str: [xxxx] schema length: 1; actual length: 4; . src line []; 
   ```
   得到如上错误提示
   
   然后通过调试查看test2的schema发现,该表的b字段类型虽然是text,但是长度只有1
   
![image](https://user-images.githubusercontent.com/22926391/199387253-a592982c-7017-4167-8560-791bfb2ce36d.png)
   
   这就导致后续的数据插入判断长度时失败
   
   
   ### What You Expected?
   
   字段类型长度正确,数据写入成功
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to