CSV导入到hive中,处理分号问题
1、导入的原数据
103744;545479945;2017.05.17 06:41:08;sell;eurusd_;0.10;1.11080;1.11280;1.10880;1.11081;0.00;0.00;
2、建表语句。分号是hdfs中的特殊字符,需要把';'转成ascII码'\073'
create table hive_trade (heyue string,login string,type string,dangliang string,price1 string,sl string,tp string,price2 string,yongjin string,shuijin string) partitioned by (dt string)ROW FORMAT DELIMITED fields terminated by '\073' collection items terminated by '\073' STORED AS TEXTFILE;
3、加载数据到hive的分区表中。
load data local inpath '/home/importData/trade-import.csv' overwrite into table hive_trade partition(dt='2017-05-17');
CSV导入到hive中,处理分号问题的更多相关文章
- 把HDFS上的数据导入到Hive中
1. 首先下载测试数据,数据也可以创建 http://files.grouplens.org/datasets/movielens/ml-latest-small.zip 2. 数据类型与字段名称 m ...
- 使用Sqoop,最终导入到hive中的数据和原数据库中数据不一致解决办法
Sqoop是一款开源的工具,主要用于在Hadoop(Hive)与传统的数据库(mysql.postgresql...)间进行数据的传递,可以将一个关系型数据库(例如 : MySQL , ...
- 自动将每日的日志增量导入到hive中
一:大纲介绍 1.导入方式 load data local inpath 'local_file_path' into table tbname partition (date='',hour='') ...
- csv 导入到 access中去
Csv中有500万数据,导入到Access中去,每6万条数据为1Table 先是参照着http://support.microsoft.com/kb/257819/zh-cn来写 1.找不到可安装的 ...
- 052 自动将每日的日志增量导入到hive中
一:大纲介绍 1.导入方式 load data local inpath 'local_file_path' into table tbname partition (date='',hour='') ...
- Talend 将Oracle中数据导入到hive中,根据系统时间设置hive分区字段
首先,概览下任务图: 流程是,先用tHDFSDelete将hdfs上的文件删除掉,然后将oracle中的机构表中的数据导入到HDFS中:建立hive连接->hive建表->tJava获取系 ...
- 使用Talend Open Studio将数据分步从oracle导入到hive中
先使用Tos建立模型,将Oracle中的数据导入到本地: build job后,形成独立可以运行的程序: 将生成的zip文件,上传到hadoop集群上,有hive环境的机器上: [hive@h1 wo ...
- 将Mongodb的表导入到Hive中
1.官方文档:https://docs.mongodb.com/ecosystem/tools/hadoop/ 2.Hive介绍: Hive特点: 1.hive是一个数据仓库,和oracle,mysq ...
- 使用sqoop将mysql数据导入到hive中
首先准备工具环境:hadoop2.7+mysql5.7+sqoop1.4+hive3.1 准备一张数据库表: 接下来就可以操作了... 一.将MySQL数据导入到hdfs 首先我测试将zhaopin表 ...
随机推荐
- nginx502问题
常见的502错误1.配置错误因为nginx找不到php-fpm了,所以报错,一般是fastcgi_pass后面的路径配置错误了,后面可以是socket或者是ip:port 2.资源耗尽lnmp架构在处 ...
- Vue 学习笔记之 —— 组件(踩了个坑)
最近在学习vue,学习组件时,遇到了一个问题,困扰了半个多小时.. <!DOCTYPE html> <html lang="en"> <head> ...
- .ssh 别名连接
参考ssh支持配置 man ssh_config 配置模板 vim ~/.ssh/config Host <别名> Port <机器端口号> IdentityFile < ...
- react-swiper 如何实现滑动小卡片的移动?
1.引入插件 import ReactSwipes from 'react-swipes'; import './swiperCard.css'; 2.代码构成 export default clas ...
- centos 时区设置初认识
由于一些需要,我租用了一个海外服务器,并开始了我的centos之旅. 由于之前一直用虚拟机,而且在国内,所以不需要考虑时区的问题,但是现在,这个服务器是在海外的,所以就必须考虑时区的问题了.更何况我的 ...
- Tomcat Architect
Tomcat Architect Hierarchy of nested tag representing different components in server.xml. 1 <Serv ...
- C#操作Word的+ CKEditor 輸出成Word文件(包含圖案上傳)
C#操作Word 参考博文: C#操作word类文件 https://www.cnblogs.com/walking/p/3571068.html C#中的Office操作专栏(21) http:// ...
- vue app外卖(5) 使用swiper 进行图片轮播
1.查看swiper 文档 https://www.swiper.com.cn/usage/index.html 2. 下载 npm install --save swiper 3.在页面引入 imp ...
- Android Studio Download
{ https://developer.android.google.cn/studio }
- JAVA单线程和多线程的实现方式
1.java单线程的实现 一个任务一个人独立完成 public class SingletonThread { @SuppressWarnings("static-acce ...