这是我在hive中的查询
select colname from uber_test;
OK
{"data":"{\"age\":42, \"gender\":\"male\"}"}
这是我导出数据的方式:
CREATE TABLE export_test_1( name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE;
INSERT OVERWRITE LOCAL DIRECTORY 'export_test_1' ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' select colname from uber_test;
这是我导出后的数据:
more export_test_2/000000_0
data{"age":42, "gender":"male"}
我需要保留json。需要:
{"data":"{\"age\":42, \"gender\":\"male\"}"}