hive中导入csv,本地CSV导入hive表

背景 从mysql 导出的数据保存为csv文件

导出两个文件,一个有csv的文件头 record1.csv

一个没有csv文件的文件头 record0.csv

try1

建表语句直接导入

sql='''

CREATE TABLE IF NOT EXISTS default.records

(

exer_recore_id BIGINT,

user_id int,

channel tinyint,

item_id int,

question_id int,

`type` tinyint,

question_num int,

orgin tinyint,

orgin_id int,

cate_id int,

is_hf tinyint,

user_answer string,

correct_answer string,

is_correct tinyint comment "正确与否",

dutration int,

record_id int,

subject_1 int,

subject_2 int,

subject_3 int,

status tinyint,

is_signed tinyint,

create_time int,

practice_level_1 string,

practice_level_2 string,

practice_level_3 string,

update_time int

)

你可能感兴趣的:(hive中导入csv)