Hdfs 导入Hive,时间相关的字段 导入后为NULL

CREATE TABLE  OFFER_${day_id}
(
OFFER_ID    BIGINT,
ATOM_ACTION_ID  BIGINT,
PARTY_ID    BIGINT,
OFFER_SPEC_ID   BIGINT,
OFFER_NBR   STRING,
AREA_ID INT,
MKT_ACTIVITY_ID BIGINT,
START_DT    STRING,
END_DT  STRING,
BSS_START_DT    STRING,
BSS_END_DT  STRING,
BILL_START_DT   STRING,
BILL_END_DT STRING,
STATUS_CD   STRING,
STATUS_DT   STRING,
CREATE_DT   STRING,
VERSION STRING,
EXT_PROD_OFFER_INST_ID  STRING,
EXT_SYSTEM  STRING

) ROW FORMAT DELIMITED
FIELDS TERMINATED BY ''
STORED AS TEXTFILE;

解决办法: 之前在Hive中创建表的时候,时间相关的字段建的是DATE类型,发现导入Hive后,DATE字段的值都是NULL。 后来都将DATE类型的字段调整成了STRING类型,经测试,时间相关的字段均可入hive。

你可能感兴趣的:(hive,String,hdfs)