Hadoop sqoop--作为拼花文件:导入文件中的类型错误
我正在使用Cloudera的QuckStart CDH5.4 VMware映像。其中包含SQOOP1.4.5 我从一个非常简单的Oracle Database 10g Enterprise Edition 10.2.0.4.0-64位生产表导入:Hadoop sqoop--作为拼花文件:导入文件中的类型错误,hadoop,sqoop,Hadoop,Sqoop,我正在使用Cloudera的QuckStart CDH5.4 VMware映像。其中包含SQOOP1.4.5 我从一个非常简单的Oracle Database 10g Enterprise Edition 10.2.0.4.0-64位生产表导入: create table SIMPLETBL ( id NUMBER(38,0), firstname varchar2(64), lastname varchar2(64), entry
create table SIMPLETBL (
id NUMBER(38,0),
firstname varchar2(64),
lastname varchar2(64),
entry date
);
我使用以下sqoop
调用导入HDFS中的暂存目录:
#!/bin/bash
sqoop import \
--verbose \
--username theuser --password thepassword \
--connect jdbc:oracle:thin:@x.y.z.x:1565:sidd \
--table THEUSER.SIMPLETBL \
--target-dir /archive/xxx/stage_pk \
-m 1 --as-parquetfile
HDFS目录/archive/xxx/stage_pk
由sqoop
创建,其中只包含一个文件。我把它移到了拼花地板桌子的目录:
hdfs dfs -mv /archive/xxx/stage_pk/\* /archive/xxx/pktbl
impala shell
告诉我关于我的拼花文件表:
[quickstart.cloudera:21000] > select * from pktbl limit 10;
Query: select * from pktbl limit 10
ERROR: File 'hdfs://quickstart.cloudera:8020/archive/xxx/pktbl/afd5eba5-b1e9-462b-9e23-3df6dcdfab22.parquet'
has an incompatible type with the table schema for column 'ID'.
Expected type: INT32. Actual type: BYTE_ARRAY
两列firstname
和lastname
似乎正确进入拼花地板表,但日期格式列不正确:
[quickstart.cloudera:21000] > select entry from pktbl limit 10;
Query: select entry from pktbl limit 10
ERROR: File 'hdfs://quickstart.cloudera:8020/archive/xxx/pktbl/afd5eba5-b1e9-462b-9e23-3df6dcdfab22.parquet'
has an incompatible type with the table schema for column 'ENTRY'.
Expected type: INT96. Actual type: INT64
是否有一些技巧可以让sqoop
创建impala
可以理解的拼花文件?似乎sqoop
1.4.5错误地获取了除“string”之外的所有数据类型