hive is not a Parquet file. expected magic number at tail [80, 65, 82, 49] but found [48,46, 48,10]

1、创建表

create table if not exists yourtalle(`score` float, `pos` string)  ROW FORMAT DELIMITED FIELDS TERMINATED BY '|';

2、导入数据

load data local inpath "***" overwrite  into table yourtable;
    导入数据格式举例:
1.0|1
2.0|2
3.2|4

3、select * from yourtable即出现标题中的错误:

    hive is not a Parquet file. expected magic number at tail [80, 65, 82, 49] but found [48,46, 48,10]

4、原因

    hive有多中存储形式:textfile/sequencefile/Parquet。

    导入的本地数据文件是textfile形式,但是默认行情况下表的存储形式是Parquet,所以会出现错误。解决该问题只需要在创建表的时候明确定义存储形式即可。

create table if not exists yourtalle(`score` float, `pos` string)  ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' stored as   textfile ;

    

你可能感兴趣的:(hive)