Extra Data after Last Expected Column:hawq建外表load数据报错
背景:使用sqoop import 才oracle抽數據入HDFS后,通過pxf建立hawq外表,查詢數據報錯
解決思路:1、從報錯上看應該是數據源分割后字段數比目標表字段多,且pgadmin3里報錯還出現源數據異常的一條記錄,去源頭oracle查看對應的記錄,發現地段內部包含分隔符。
? ?2、重新執行sqoop import 并用 " \t "分隔,問題解決。
Loading Data from a Flat File "ERROR: Extra Data after Last Expected Column"
Chloe Jackson
March 23, 2017 16:26Environment
| ?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 columnCause
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 empTable "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.
官方給出的解決方案如下:
總結
以上是生活随笔為你收集整理的Extra Data after Last Expected Column:hawq建外表load数据报错的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux版的navicat提示丢失sc
- 下一篇: js+获取当前域名及跳转、下载操作