043.hive-导出数据hive-csv
1. su hdfs cd ~ 2. hive -e " set hive.cli.print.header=true; USE saas; SELECT CONCAT_WS(',', cast( nvl(order_id ,0) as string) ,cast( nvl(total_amount ,0.00) as string) ,cast( nvl(dinner_count ,0) as string) ,cast( nvl(latitude ,0.00) as string) ,cast( nvl(longitude ,0.00) as string) ,cast( nvl(has_invoice ,0) as string) ,cast( nvl(invoice_type ,0) as string) ,cast( nvl(invoice_title ,'') as string) ,cast( nvl(invoice_taxpayer ,'') as string) ,cast( nvl(description ,'') as string) ,cast( nvl(place_time,cast('1000-01-01 00:00:00' as timestamp)) as string) ,cast( nvl(delivery_time,cast('1000-01-01 00:00:00' as timestamp)) as string) ,cast( nvl(order_type ,'') as string) ,cast( nvl(status ,'') as string) ,cast( nvl(create_time,cast('1000-01-01 00:00:00' as timestamp)) as string) ,cast( nvl(dt ,0) as string) ,cast( nvl(data_source ,'') as string)) from order_di where shop_code = '76729050' ; " | sed 's/[\t]/,/g' > one_shop.csv 3.压缩 zip -r one_shop.zip one_shop.csv 4.sz one_shop.zip 5.csv 注意科学计数法的转换
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
2021-07-26 033.PGSQL-psql-登录时执行sql命令和sql文件,传递参数
2021-07-26 032.PGSQL-pgsql的except-除了, intersect-交集
2021-07-26 031.PGSQL-psql-导入导出数据COPY 和\copy命令