我正在使用直线从配置单元中导出查询结果,这是我的命令:
beeline -u 'jdbc:hive2://myhost.com:10000/mydb;principal=hive/myhost.COM' --incremental=true --silent=true --outputformat=dsv --disableQuotingForSV=true --delimiterForDSV=\, --showHeader=false --nullemptystring=true -f myquery.hql --hiveconf DT_ID=${DT_ID} > ${spoolFile}
这是我的查询:
SELECT id, concat('"',c_name,'"'), app_name from mytab where dt_id='${hiveconf:DT_ID}';
但是我得到这样的结果,对于在列值中有我的字段分隔符(,)的字段:
66,**^@**"(Chat\, Social\, Music\, Utilities)"**^@**,Default
注意^@。为什么会来?怎么能避免呢?那个角色是什么?如果是报价,我将拥有它,以便我可以删除查询中的连接。我试着玩--disableQuotingForSV=true/false
。但这对我没有帮助。