drill 表&&视图使用

1.  table 
 
  1. create table table_name as select * from storage_name.dbname.tablename
 
2. view
 
  1. create view view_name as select * from storage_name.dbname.tablename
 
3. 注意问题
 
如果需要进行存储,对应的storage 必须是可写的,不然会提示错误。
比如:默认的dfs 配置
  1. "root":{
  2. "location":"/",
  3. "writable":false,
  4. "defaultInputFormat":null
  5. },
  6. "tmp":{
  7. "location":"/tmp",
  8. "writable":true,
  9. "defaultInputFormat":null
  10. }
  11. },
只能在dfs.tmp 下进行view table 创建,其他地方不行
hadoop 类似如下:
 
  1. "root":{
  2. "location":"/",
  3. "writable":false,
  4. "defaultInputFormat":null
  5. },
  6. "userapps":{
  7. "location":"/userapps",
  8. "writable":true,
  9. "defaultInputFormat":null
  10. },
  11. "tmp":{
  12. "location":"/tmp",
  13. "writable":true,
  14. "defaultInputFormat":null
  15. }
其中userapps 是自己手工创建的同时设置可写,这样查询分析的数据就可以存储到hadoop ,
方便后期的 查询,归档。





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值