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          |
+-------------------+-----------------+------------------+-------------------+----------------------+--------------+--------------+-----------------+--------------+-------------+------------+-------------------+------------------+------------------+------------------+--------------+----------------------+---------------+-----------------+-------------------+---------------------+------------------------+-------------+----------------+----------------------+-------------------+----------------------+------------------------+----------------+---------------+----------------------+---------------------+--------------+----------------+-------------------+-------------------+-------------------+-----------------+--------------+----------------+-------------+----------------+------------------+---------------+-----------------+------------------+---------------+-------------------+-------------------+------------------+-------------------+------------------+-------------------------+------------------------+-------------------+----------------+--------------+-------------------------+------------------------+----------------------------+---------------------------+-------------------------------+------------------------------+-----------------+--------------------+-----------------------+------------+------------+--+

最新文章

  1. windows Service
  2. JavaWeb高级:Servlet源码分析
  3. arcgis 栅格计算器(Spatial Analyst/Raster Calculator)
  4. ios学习笔记block回调的应用(一个简单的例子)
  5. CentOS 6.5 CodeBlocks::wxWidgets安装与配置
  6. 2017 CVTE春招内推专场 C/C++软件开发岗笔试编程题
  7. RTMP协议中文翻译(首发)
  8. 关于Maven中打包命令(项目中打补丁的时候用到)
  9. 第11章 使用OpenID Connect添加用户身份验证 - Identity Server 4 中文文档(v1.0.0)
  10. Linux系统诊断必备技能之二:tcpdump抓包工具详解
  11. ambari 安装HDP3.0.1后,启动服务的问题记录
  12. python sort和sorted区别。
  13. Dockerfile指令详解
  14. .NET Core使用Quartz执行调度任务进阶(转)
  15. 第六节 静态的(static)和单例模式
  16. Spring Boot 邮件配置
  17. 第二章 ConcurrentHashMap源码解析
  18. ASP.NET SignalR-B.S/C.S 相互打通DEMO
  19. HTML基础之DOM常用操作
  20. Macbook Pro开机黑屏了。

热门文章

  1. wpf menuitem 简约显示的 template样式
  2. js点击发送验证码 xx秒后重新发送
  3. JavaScript事件的基本学习
  4. python之初入Python
  5. linux tty终端个 pts伪终端 telnetd伪终端
  6. Lua游戏逆向及破解方法介绍
  7. 【2017-04-10】js来控制导航栏在滚动条拉到一定位置时显示
  8. Python——列表赋值的若干用例
  9. 常用到用css3实现的转换,过渡和动画
  10. Java常用类(一)Math类和Random类