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