hadoop - HDFS - 最后一个预期列之后的额外数据

标签 hadoop hdfs greenplum external-tables hawq

我们有源系统和目标系统。尝试使用 talend 工具将数据从 SQL server 2012 导入到 Pivotal Hadoop (PHD 3.0) 版本。

获取错误:

ERROR: extra data after last expected column  (seg0 slice1 datanode.domain.com:40000 pid=15035)
  Detail: External table pick_report_stg0, line 5472 of pxf://masternnode/path/to/hdfs?profile=HdfsTextSimple: "5472;2016-11-28 08:39:54.217;;2016-11-15 00:00:00.0;SAMPLES;0005525;MORGAN -EVENTS;254056;1;IHBL-NHO..."

我们尝试过

我们已将 BAD 行标识为 [hdfs@mdw ~]$ hdfs dfs -cat/path/to/hdfs|grep 3548

3548;2016-11-28 04:21:39.97;;2016-11-15 00:00:00.0;SAMPLES;0005525;MORGAN -EVENTS;254056;1;IHBL-NHO-13OZ-01;0;ROC NATION; NH;2016-11-15 00:00:00.0;2016-11-15 00:00:00.0;;2.0;11.99;SA;SC01;NH02;EA;1;F2;NEW PKG ONLY PLEASE!! BY NOON

外部表的结构和格式子句

CREATE EXTERNAL TABLE schemaname.tablename
(
"ID" bigint,
  "time" timestamp without time zone,
  "ShipAddress4" character(40),
  "EntrySystemDate" timestamp without time zone,
  "CorpAcctName" character(40),
  "Customer" character(7),
  "CustomerName" character(30),
  "SalesOrder" character(6),
  "OrderStatus" character(1),
  "MStockCode" character(30),
  "ShipPostalCode" character(9),
  "CustomerPoNumber" character(30),
  "OrderDate" timestamp without time zone,
  "ReqShipDate" timestamp without time zone,
  "DateValue" timestamp without time zone,
  "MOrderQty" numeric(9,0),
  "MPrice" numeric(9,0),
  "CustomerClass" character(2),
  "ProductClass" character(4),
  "ProductGroup" character(10),
  "StockUom" character(3),
  "DispatchCount" integer,
  "MWarehouse" character(2),
  "AlphaValue" varchar(100)
)
 LOCATION (
    'pxf://path/to/hdfs?profile=HdfsTextSimple'
)
 FORMAT 'csv' (delimiter ';' null '' quote ';')
ENCODING 'UTF8';

发现: 出现额外的分号,导致额外的数据。但我仍然无法提供正确的格式子句。请指导如何删除额外的数据列错误。

我应该使用什么格式子句。

如有任何帮助,我们将不胜感激!

最佳答案

如果您将以下内容附加到您的外部表定义中,在 ENCODING 子句之后,它应该有助于解决由于此问题导致少量行失败的问题:

LOG ERRORS INTO my_err_table SEGMENT REJECT LIMIT 1 PERCENT;

这里是关于此语法的引用:http://gpdb.docs.pivotal.io/4320/ref_guide/sql_commands/CREATE_EXTERNAL_TABLE.html

关于hadoop - HDFS - 最后一个预期列之后的额外数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40845897/

相关文章:

java - hadoop mapReduce工作从未完成

hadoop - 除了 hadoop 集群中设置的时间之外,如何为长时间运行的应用程序更新委托(delegate) token

apache - Hadoop 3.2.0在群集中不起作用(VirtualBox)

postgresql - 在 plpython 中处理反斜杠

hadoop - 失败:RuntimeException Hive内部错误:尚不支持将字符串转换为void

java - 在PIG程序中找不到类DistributedFileSytem

hadoop - Ganglia 无法与 Apache HBase 通信

hadoop - HBase 键值压缩?

r - 如何在 Greenplum/Postgres 中使用 PL/R 反序列化模型对象?

database - 如何让Greenplum 4.2.3只扫描指定分区?