Environment
| Product | Version |
| Pivotal Greenplum | 4.2.x |
| OS | All Supported OS |
Symptom
Loading data from flat files result in the following error message:
ERROR: extra data after last expected column
Cause
You will encounter this error if your source data has more columns than the target table.
Resolution
You must ensure that the source data and table columns align.
Example:
-- Target table
ddata=# \d emp
Table "public.emp"
Column " Type " Modifiers
--------+---------+-----------
id " integer "
dept " integer "
role " integer "
Distributed by: (id)
-- Source data file
$ cat /tmp/load.dat 1"2"3"4 1"2"3"4 1"2"3"4 1"2"3"4 1"2"3"4 1"2"3"4
--Error
ddata=# copy emp from '/tmp/load.dat' with delimiter as '"'; ERROR: extra data after last expected column (seg0 sdw1:55001 pid=12476) CONTEXT: COPY emp, line 1: "1"2"3"4"
As can be seen from the example above, the source data file has one more column than the target table, resulting in the error described above.
本文介绍了解决在Pivotal Greenplum中加载数据时遇到的Extra Data after Last Expected Column错误的方法。该问题通常出现在源数据文件的列数与目标表的列数不匹配时。文章提供了具体的案例分析,并指导如何确保源数据与目标表的列正确对应。
6486

被折叠的 条评论
为什么被折叠?



