1.show create table tb_cdr;
+-------------------------------------------------------+--+
|                    createtab_stmt                     |
+-------------------------------------------------------+--+
| CREATE TABLE `tb_cdr`(                                |
|   `begintime` bigint,                                 |
|   `usernum` string,                                   |
|   `homearea` string,                                  |
|   `relatenum` string,                                 |
|   `relatehomeac` string,                              |
|   `imsi` string,                                      |
|   `imei` string,                                      |
|   `curarea` string,                                   |
|   `neid` string,                                      |
|   `lai` int,                                          |
|   `ci` string,                                        |
|   `longitude` float,                                  |
|   `latitude` float,                                   |
|   `billtype` string,                                  |
|   `calltype` string,                                  |
|   `dtmf` string,                                      |
|   `callduration` int,                                 |
|   `cause` string,                                     |
|   `rlgtime` bigint,                                   |
|   `alerttime` bigint,                                 |
|   `connecttime` bigint,                               |
|   `disconnecttime` bigint,                            |
|   `sid` string,                                       |
|   `idflag` int,                                       |
|   `rawrelatenum` string,                              |
|   `redirflag` int,                                    |
|   `origcalledno` string,                              |
|   `disconnecttype` int,                               |
|   `newlai` int,                                       |
|   `newci` string,                                     |
|   `newlongitude` float,                               |
|   `newlatitude` float,                                |
|   `tmsi` string,                                      |
|   `spcode` string,                                    |
|   `voiceflag` string,                                 |
|   `voicekeya` string,                                 |
|   `voicekeyb` string,                                 |
|   `peersid` string,                                   |
|   `guti` string,                                      |
|   `userip` string,                                    |
|   `cgi` string,                                       |
|   `newcgi` string,                                    |
|   `mobileip` string,                                  |
|   `imsip` string,                                     |
|   `recflag` int,                                      |
|   `holdflag` int,                                     |
|   `hocnt` int,                                        |
|   `mediatype` string,                                 |
|   `speechver` string,                                 |
|   `beartype` string,                                  |
|   `relatelai` int,                                    |
|   `relateci` int,                                     |
|   `relatelongitude` float,                            |
|   `relatelatitude` float,                             |
|   `relatecgi` string,                                 |
|   `client` string,                                    |
|   `tags` string,                                      |
|   `extra_longitude` float,                            |
|   `extra_latitude` float,                             |
|   `extra_newlongitude` float,                         |
|   `extra_newlatitude` float,                          |
|   `extra_relatelongitude` float,                      |
|   `extra_relatelatitude` float,                       |
|   `geohash` string,                                   |
|   `newgeohash` string,                                |
|   `relategeohash` string)                             |
| PARTITIONED BY (                                      |
|   `cp` bigint,                                        |
|   `ld` bigint)                                        |
| ROW FORMAT SERDE                                      |
|   'org.apache.hadoop.hive.ql.io.orc.OrcSerde'         |
| STORED AS INPUTFORMAT                                 |
|   'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'   |
| OUTPUTFORMAT                                          |
|   'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'  |
| LOCATION                                              |
|   'hdfs://hacluster/user/hive/warehouse/tb_cdr'       |
| TBLPROPERTIES (                                       |
|   'last_modified_by'='omm',                           |
|   'last_modified_time'='1504964008',                  |
|   'orc.compress'='ZLIB',                              |
|   'transient_lastDdlTime'='1504964008')               |
+-------------------------------------------------------+
2.向表中插入一条数据
insert into table tb_cdr partition(cp=1,ld=2) values(
0,
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
0,
'a',
0.0,
0.0,
'a',
'a',
'a',
0,
'a',
0,
0,
0,
0,
'a',
0,
'a',
0,
'a',
0,
0,
'a',
0.0,
0.0,
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
0,
0,
0,
'a',
'a',
'a',
0,
0,
0.0,
0.0,
'a',
'a',
'a',
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
'a',
'a',
'a');
3.查询
select * from tb_cdr where cp=1 and ld=2 limit 1;
+-------------------+-----------------+------------------+-------------------+----------------------+--------------+--------------+-----------------+--------------+-------------+------------+-------------------+------------------+------------------+------------------+--------------+----------------------+---------------+-----------------+-------------------+---------------------+------------------------+-------------+----------------+----------------------+-------------------+----------------------+------------------------+----------------+---------------+----------------------+---------------------+--------------+----------------+-------------------+-------------------+-------------------+-----------------+--------------+----------------+-------------+----------------+------------------+---------------+-----------------+------------------+---------------+-------------------+-------------------+------------------+-------------------+------------------+-------------------------+------------------------+-------------------+----------------+--------------+-------------------------+------------------------+----------------------------+---------------------------+-------------------------------+------------------------------+-----------------+--------------------+-----------------------+------------+------------+--+
| tb_cdr.begintime  | tb_cdr.usernum  | tb_cdr.homearea  | tb_cdr.relatenum  | tb_cdr.relatehomeac  | tb_cdr.imsi  | tb_cdr.imei  | tb_cdr.curarea  | tb_cdr.neid  | tb_cdr.lai  | tb_cdr.ci  | tb_cdr.longitude  | tb_cdr.latitude  | tb_cdr.billtype  | tb_cdr.calltype  | tb_cdr.dtmf  | tb_cdr.callduration  | tb_cdr.cause  | tb_cdr.rlgtime  | tb_cdr.alerttime  | tb_cdr.connecttime  | tb_cdr.disconnecttime  | tb_cdr.sid  | tb_cdr.idflag  | tb_cdr.rawrelatenum  | tb_cdr.redirflag  | tb_cdr.origcalledno  | tb_cdr.disconnecttype  | tb_cdr.newlai  | tb_cdr.newci  | tb_cdr.newlongitude  | tb_cdr.newlatitude  | tb_cdr.tmsi  | tb_cdr.spcode  | tb_cdr.voiceflag  | tb_cdr.voicekeya  | tb_cdr.voicekeyb  | tb_cdr.peersid  | tb_cdr.guti  | tb_cdr.userip  | tb_cdr.cgi  | tb_cdr.newcgi  | tb_cdr.mobileip  | tb_cdr.imsip  | tb_cdr.recflag  | tb_cdr.holdflag  | tb_cdr.hocnt  | tb_cdr.mediatype  | tb_cdr.speechver  | tb_cdr.beartype  | tb_cdr.relatelai  | tb_cdr.relateci  | tb_cdr.relatelongitude  | tb_cdr.relatelatitude  | tb_cdr.relatecgi  | tb_cdr.client  | tb_cdr.tags  | tb_cdr.extra_longitude  | tb_cdr.extra_latitude  | tb_cdr.extra_newlongitude  | tb_cdr.extra_newlatitude  | tb_cdr.extra_relatelongitude  | tb_cdr.extra_relatelatitude  | tb_cdr.geohash  | tb_cdr.newgeohash  | tb_cdr.relategeohash  | tb_cdr.cp  | tb_cdr.ld  |
+-------------------+-----------------+------------------+-------------------+----------------------+--------------+--------------+-----------------+--------------+-------------+------------+-------------------+------------------+------------------+------------------+--------------+----------------------+---------------+-----------------+-------------------+---------------------+------------------------+-------------+----------------+----------------------+-------------------+----------------------+------------------------+----------------+---------------+----------------------+---------------------+--------------+----------------+-------------------+-------------------+-------------------+-----------------+--------------+----------------+-------------+----------------+------------------+---------------+-----------------+------------------+---------------+-------------------+-------------------+------------------+-------------------+------------------+-------------------------+------------------------+-------------------+----------------+--------------+-------------------------+------------------------+----------------------------+---------------------------+-------------------------------+------------------------------+-----------------+--------------------+-----------------------+------------+------------+--+
| 0                 | a               | a                | a                 | a                    | a            | a            | a               | a            | 0           | a          | 0.0               | 0.0              | a                | a                | a            | 0                    | a             | 0               | 0                 | 0                   | 0                      | a           | 0              | a                    | 0                 | a                    | 0                      | 0              | a             | 0.0                  | 0.0                 | a            | a              | a                 | a                 | a                 | a               | a            | a              | a           | a              | a                | a             | 0               | 0                | 0             | a                 | a                 | a                | 0                 | 0                | 0.0                     | 0.0                    | a                 | a              | a            | 0.0                     | 0.0                    | 0.0                        | 0.0                       | 0.0                           | 0.0                          | a               | a                  | a                     | 1          | 2          |
+-------------------+-----------------+------------------+-------------------+----------------------+--------------+--------------+-----------------+--------------+-------------+------------+-------------------+------------------+------------------+------------------+--------------+----------------------+---------------+-----------------+-------------------+---------------------+------------------------+-------------+----------------+----------------------+-------------------+----------------------+------------------------+----------------+---------------+----------------------+---------------------+--------------+----------------+-------------------+-------------------+-------------------+-----------------+--------------+----------------+-------------+----------------+------------------+---------------+-----------------+------------------+---------------+-------------------+-------------------+------------------+-------------------+------------------+-------------------------+------------------------+-------------------+----------------+--------------+-------------------------+------------------------+----------------------------+---------------------------+-------------------------------+------------------------------+-----------------+--------------------+-----------------------+------------+------------+--+

hive分区表插入一条测试数据的更多相关文章

  1. mysql中迅速插入百万条测试数据的方法

    对比一下,首先是用 mysql 的存储过程弄的: 复制代码代码如下: mysql>delimiter $ mysql>SET AUTOCOMMIT = 0$$ mysql> crea ...

  2. Oracle中插入千万条测试数据

    测试需求,id.姓名.邮箱.手机号不可重复 1.创建序列 create sequence id_sequence; //创建序列id_sequence 2.创建表 create table USERI ...

  3. 利用MySQL存储过程批量插入100W条测试数据

    DROP PROCEDURE IF EXISTS insert_batch; CREATE PROCEDURE insert_batch() BEGIN ; loopname:LOOP '); ; T ...

  4. Hadoop: the definitive guide 第三版 拾遗 第十二章 之Hive分区表、桶

    Hive分区表 在Hive Select查询中一般会扫描整个表内容,会消耗很多时间做没必要的工作.有时候只需要扫描表中关心的一部分数据,因此建表时引入了partition概念.分区表指的是在创建表时指 ...

  5. Hive分区表的导入与导出

    最近在做一个小任务,将一个CDH平台中Hive的部分数据同步到另一个平台中.毕竟我也刚开始工作,在正式开始做之前,首先进行了一段时间的练习,下面的内容就是练习时写的文档中的内容.如果哪里有错误或者疏漏 ...

  6. 记录一次mysql导入千万条测试数据过慢的问题!

    数据库在没有做任何优化的情况下,使用存储过程,插入1千万条测试数据. CREATE PROCEDURE addmaxdata(IN n int) BEGIN DECLARE i INT DEFAULT ...

  7. MySQL快速生成100W条测试数据

    https://blog.csdn.net/qq_16946803/article/details/81870174 1.生成思路利用mysql内存表插入速度快的特点,先利用函数和存储过程在内存表中生 ...

  8. java之5分钟插入千万条数据

    虽说不一定5分钟就插入完毕,因为取决去所插入的字段,如果字段过多会稍微慢点,但不至于太慢.10分钟内基本能看到结果. 之前我尝试用多线程来实现数据插入(百万条数据),半个多小时才二十多万条数据. 线程 ...

  9. Oracle-创建新表,创建备份表,对表中插入多条数据

    一.创建新表 0.基本语法 create table 表名称(id varchar2(50) primary key ,name char(200) not null,phone number(11) ...

随机推荐

  1. MVC4中使用EntityFramework

    首先,MVC4不支持EntityFramwok 6版本,如果安装了EntityFramwok 6,则vs不会自动引用dll和修改web.config配置.先删除旧的版本,执行指令:Uninstall- ...

  2. 解决EntityFramework与System.ComponentModel.DataAnnotations命名冲突

    比如,定义entity时指定一个外键, [ForeignKey("CustomerID")] public Customer Customer { get; set; } 编译时报 ...

  3. SSD训练网络参数计算

    一个预测层的网络结构如下所示: 可以看到,是由三个分支组成的,分别是"PriorBox"层,以及conf.loc的预测层,其中,conf与loc的预测层的参数是由PriorBox的 ...

  4. O045、理解 Cinder 架构

    参考https://www.cnblogs.com/CloudMan6/p/5573159.html   从本节开始我们学习OpenStack 的 Block Storage Service ,Cin ...

  5. java字符常量

    在Java程序中经常会遇到类似于"Hello"这样地字符串,那么这种类型的字符串是Java中是如何存储,下面就说明字符串常量在内存中存储方式: Java程序在编译时会将程序中出现的 ...

  6. Invalid prop: custom validator check failed for prop "pagerCount"

    在element分页中使用pager-count报错: vue.esm.js?c5de:628 [Vue warn]: Invalid prop: custom validator check fai ...

  7. 解决GitHub下载资源慢的问题

    打开 C:\Windows\System32\drivers\etc\hosts 添加 # GitHub 解决下载速度慢的问题 192.30.253.113 github.com 151.101.18 ...

  8. linux 删除文件空间未释放问题

    现象:我们测试环境上,导出数据文件时,由于作业报错,重复导出,空间使用到达100%,按理说,导出的文件时在相同的路径下,文件名也是一致的,会自动替换. 那么之前导出的文件会被删除,问题就出现在删除这一 ...

  9. python调用其他脚本

    1.用python调用python脚本 #!/usr/local/bin/python3. import time import os count = str = ('python b.py') re ...

  10. 如何判断kbmMWClientQuery当前记录的增改状态?

    有朋友问我,客户端使用了kbmMWClientQuery,对其进行了编辑后,对于指定的记录,如何判断是否是增加的记录,或者是被修改后的记录? 下面这个函数,返回aDataSet当前记录的修改状态: f ...