网站首页 > 博客文章 正文
背景:
后台有小伙伴问我,做数据分析的时候,经常会用到hive -e "sql" > result.csv,然后将结果导入到excel中,可是使用hive -e导出后默认的分隔符是\t,excel无法识别,所以需要将\t 转成(逗号) 该如何让做呢?
方案一:使用linux管道符替换
hive -e "select * from table_name limit 100" | sed 's/\t/,/g' > result.csv
方案二:使用 hive insert 导数据到本地,指定分隔符
insert overwrite local directory '/home/hadoop/20180303' row format delimited fields terminated by ',' select * from table_name limit 100
这两种方案基本上足够了,如果小伙伴们有更好的方案,欢迎一起交流。
点击阅读原文,获取更多学习资料。
猜你喜欢
- 2024-10-07 Flink1.10集成Hive快速入门(flink集群)
- 2024-10-07 Spark源码阅读:SparkSession类之spark对象的使用
- 2024-10-07 存储过程转hivesql有哪些注意事项
- 2024-10-07 0277-Impala并发查询缓慢问题解决方案
- 2024-10-07 画像笔记25-用户画像应用(10)-用户行为分析
- 2024-10-07 CASE … WHEN和cast类型转换(日志案例分析应用)
- 2024-10-07 hbase和hive集成映射(hive与hbase集成)
- 2024-10-07 Hive SQL常用命令总结,大数据开发人员按需收藏
- 2024-10-07 手撕数据仓库之「HQL规范篇」(数据仓库 sql)
- 2024-10-07 hive 之前操作脚本汇总(hive shell脚本)
你 发表评论:
欢迎- 07-08Google Cloud Platform 加入支持 Docker 的容器引擎
- 07-08日本KDDI与Google Cloud 签署合作备忘录,共探AI未来
- 07-08美国Infoblox与Google Cloud合作推出云原生网络和安全解决方案
- 07-08GoogleCloud为Spanner数据库引入HDD层,将冷存储成本降低80%
- 07-08谷歌推出Cloud Dataproc,缩短集群启动时间
- 07-08Infovista与Google Cloud携手推进射频网络规划革新
- 07-08比利时Odoo与Google Cloud建立增强合作,扩大全球影响力
- 07-08BT 和 Google Cloud 通过 Global Fabric 加速 AI 网络
- 最近发表
-
- Google Cloud Platform 加入支持 Docker 的容器引擎
- 日本KDDI与Google Cloud 签署合作备忘录,共探AI未来
- 美国Infoblox与Google Cloud合作推出云原生网络和安全解决方案
- GoogleCloud为Spanner数据库引入HDD层,将冷存储成本降低80%
- 谷歌推出Cloud Dataproc,缩短集群启动时间
- Infovista与Google Cloud携手推进射频网络规划革新
- 比利时Odoo与Google Cloud建立增强合作,扩大全球影响力
- BT 和 Google Cloud 通过 Global Fabric 加速 AI 网络
- NCSA和Google Cloud合作开发AI驱动的网络防御系统,加强泰国网络空间的安全性
- SAP将在沙特阿拉伯 Google Cloud 上推出BTP服务
- 标签列表
-
- ifneq (61)
- 字符串长度在线 (61)
- googlecloud (64)
- messagesource (56)
- promise.race (63)
- 2019cad序列号和密钥激活码 (62)
- window.performance (66)
- qt删除文件夹 (72)
- mysqlcaching_sha2_password (64)
- ubuntu升级gcc (58)
- nacos启动失败 (64)
- ssh-add (70)
- jwt漏洞 (58)
- macos14下载 (58)
- yarnnode (62)
- abstractqueuedsynchronizer (64)
- source~/.bashrc没有那个文件或目录 (65)
- springboot整合activiti工作流 (70)
- jmeter插件下载 (61)
- 抓包分析 (60)
- idea创建mavenweb项目 (65)
- vue回到顶部 (57)
- qcombobox样式表 (68)
- tomcatundertow (58)
- pastemac (61)
本文暂时没有评论,来添加一个吧(●'◡'●)