infinidb table with a varchar column insert string as a '_CpNoTf_' while using Cpimport.
The Problem is occured if inserted string length is greater than column length.
For Example a table.
CREATE TABLE employee (
emp_id int(8) NOT NULL,
name varchar(10) NOT NULL
) ENGINE=InfiniDB DEFAULT CHARSET=latin1;
employee.csv file have following lines. and the "1236~hi this is dummy test" have name field is having 22 charcter which is greater than table column length.
1234~haresh
1235~john
1236~hi this is dummy test
1237~peter
Now let's import employee in table using infinidb cpimport functionality.
cpimport databasename employee employee.csv -s '~' -e 5000
[Output of Cpimport:]
2014-02-25 06:33:42 (22187) INFO : Reading input from STDIN to import into table emp.employee...
2014-02-25 06:33:42 (22187) INFO : Running distributed import (mode 1) on all PMs...
2014-02-25 06:33:43 (22187) INFO : For table emp.employee: 4 rows processed and 3 rows inserted.
2014-02-25 06:33:43 (22187) WARN : Column emp.employee.name; Number of varchar strings truncated: 1
2014-02-25 06:33:43 (22187) INFO : Bulk load completed, total run time : 1.58981 seconds
[Output of table:]
mysql> select * from employee;
+------------+----------+
| emp_id | name |
+------------+----------+
| 1234 | haresh |
| 1235 | john |
| 1236 | _CpNoTf_ |
| 1237 | peter |
+------------+----------+
1 row in set (0.15 sec)
The Problem is occured if inserted string length is greater than column length.
For Example a table.
CREATE TABLE employee (
emp_id int(8) NOT NULL,
name varchar(10) NOT NULL
) ENGINE=InfiniDB DEFAULT CHARSET=latin1;
employee.csv file have following lines. and the "1236~hi this is dummy test" have name field is having 22 charcter which is greater than table column length.
1234~haresh
1235~john
1236~hi this is dummy test
1237~peter
Now let's import employee in table using infinidb cpimport functionality.
cpimport databasename employee employee.csv -s '~' -e 5000
[Output of Cpimport:]
2014-02-25 06:33:42 (22187) INFO : Reading input from STDIN to import into table emp.employee...
2014-02-25 06:33:42 (22187) INFO : Running distributed import (mode 1) on all PMs...
2014-02-25 06:33:43 (22187) INFO : For table emp.employee: 4 rows processed and 3 rows inserted.
2014-02-25 06:33:43 (22187) WARN : Column emp.employee.name; Number of varchar strings truncated: 1
2014-02-25 06:33:43 (22187) INFO : Bulk load completed, total run time : 1.58981 seconds
[Output of table:]
mysql> select * from employee;
+------------+----------+
| emp_id | name |
+------------+----------+
| 1234 | haresh |
| 1235 | john |
| 1236 | _CpNoTf_ |
| 1237 | peter |
+------------+----------+
1 row in set (0.15 sec)
No comments:
Post a Comment