先全量更新历史数据 在增量更新每日数据 ?
更新以下这个需求{最近30.7天昨天每天异常交易的占比} 数据量200w左右 。
可以用伪表伪字段代替,麻烦把逻辑说下 ...
HSQL更新 尽量详细点多谢啦
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
关注 全量导出 HQL示例:insert overwrite directory ‘/user/root/export/test’ row format delimited fields terminated by ‘,’ STORED AS textfile select F1,F2,F3 from <sourceHiveTable>; SQOOP脚本:sqoop export --connect jdbc:mysql://localhost:3306/wht --username root --password cloudera --table <targetTable> --fields-terminated-by ',' --columns F1,F2,F3 --export-dir /user/root/export/test 增量导出(insert模式) HQL示例:insert overwrite directory ‘/user/root/export/test’ row format delimited fields terminated by ‘,’ STORED AS textfile select F1,F2,F3 from <sourceHiveTable> where <condition>; SQOOP脚本:sqoop export --connect jdbc:mysql://localhost:3306/wht --username root --password cloudera --table <targetTable> --fields-terminated-by ‘,’ --columns F1,F2,F3 --update-key F4 --update-mode allowinsert --export-dir /user/root/export/test 更新导出(update模式) HQL示例:insert overwrite directory ‘/user/root/export/test’ row format delimited fields terminated by ‘,’ STORED AS textfile select F1,F2,F3 from <sourceHiveTable> where <condition>; SQOOP脚本:sqoop export --connect jdbc:mysql://localhost:3306/wht --username root --password cloudera --table <targetTable> --fields-terminated-by ‘,’ --columns F1,F2,F3 --update-key F4 --update-mode updateonly --export-dir /user/root/export/test
解决 无用评论 打赏 举报
悬赏问题
- ¥15 maple软件,用solve求反函数出现rootof,怎么办?
- ¥50 汇编语言除法溢出问题
- ¥65 C++实现删除N个数据列表共有的元素
- ¥15 Visual Studio问题
- ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
- ¥20 求一个html代码,有偿
- ¥100 关于使用MATLAB中copularnd函数的问题
- ¥20 在虚拟机的pycharm上
- ¥15 jupyterthemes 设置完毕后没有效果
- ¥15 matlab图像高斯低通滤波