hive报FAILED: ParseException line 1:65 cannot recognize input near 'row' 'formatted' 'delimited' in table row format specification
错误语句:
insert overwrite local directory '/home/ljpbd/datas/student' row formatted delimited fields terminated by '\t' select id,name from student;
正确语句:
insert overwrite local directory '/home/ljpbd/datas/student' row format delimited fields terminated by '\t' select id,name from student;
正确语法:INSERT OVERWRITE [LOCAL] DIRECTORY directory [ROW FORMAT row_format] [STORED AS file_format] select_statement; 注意事项:保存的文件夹中不可有其他文件,会被清空; 例子:可以将数据保存成json格式 insert overwrite local directory '/opt/module/datas/student' ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.JsonSerDe' select id,name from student;
输出格式:
{"_col0":1001,"_col1":"student1"}
{"_col0":1002,"_col1":"student2"}
{"_col0":1003,"_col1":"student3"}
{"_col0":1004,"_col1":"student4"}
{"_col0":1005,"_col1":"student5"}
{"_col0":1006,"_col1":"student6"}
{"_col0":1007,"_col1":"student7"}
{"_col0":1008,"_col1":"student8"}
{"_col0":1009,"_col1":"student9"}
- 39 ParseException specification formatted delimited39 parseexception specification formatted 39 parseexception specification destination 39 parseexception constraint recognize format 39 delimiter delimited parseexception delimiter statement mybatis idea quot delimiter reference数据 quot parseexception mybatis-plus encountered