create index [index_studentid] on table student_3(studentid) as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild IN TABLE index_table_student_3; CompactIndexHandler :创建索引需要的实现类 index_studentid:索引名称 student_3:表名 index_table_student_3:创建索引后...
3. Hive表和视图相关的元数据表 主要有TBLS、TABLE_PARAMS、TBL_PRIVS,这三张表通过TBL_ID关联。 3.1 TBLS 该表中存储Hive表、视图、索引表的基本信息。 | 元数据表字段 | 说明 | 示例数据 | | --- | --- | --- | | TBL_ID | 表ID | 1 | | CREATE_TIME | 创建时间 | 1436317071 | | DB...
TBL_TYPE 表类型 MANAGED_TABLE、EXTERNAL_TABLE、INDEX_TABLE、VIRTUAL_VIEW VIEW_EXPANDED_TEXT 视图的详细HQL语句 select `lxw1234`.`pt`, `lxw1234`.`pcid` from `liuxiaowen`.`lxw1234` VIEW_ORIGINAL_TEXT 视图的原始HQL语句 select * from lxw1234 2、TABLE_PARAMS 该表存储表/视图的属性信息。 元数...
在原表user上创建索引user_index,得到创建索引后的表user_index_table CREATE INDEX user_index ON TABLE user(id) AS 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' WITH deferred REBUILD IN TABLE user_index_table; 或者如下写都是一样的,建议如下写 hive > create index user_index on t...
as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild IN TABLE table_index PARTITIONED BY (d,eid) ; 1. 2. 3. 4. 5. 6. 7. 第三步 重建索引,这里,如果你的表已经有分区有数据,那么你可以对单个分区重建索引,也可以对整个表建立索引,但通过实践,是在表中未产生...
> IN TABLE user_index_table; 1. 2. 3. 4. 或者 CREATE INDEX user_index ON TABLE user(id) AS 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' WITH deferred REBUILD IN TABLE user_index_table; 1. 这样就对索引测试表user创建好了一个索引。索引名字为user_index。创建索引后的表命...
1. 表类型MANAGED_TABLE、EXTERNAL_TABLE、INDEX_TABLE、VIRTUAL_VIEW MANAGED_TABLE -- MANAGED_TABLE 建表语句-- tablecreatetabletest_mamaged_table(context string); 这种表也被称作Internal Table.这是Hive中的默认的类型.如果你在创建表的时候没有指明Managed或者External,那么默认就会给你创建Managed Table。
我们在使用之前上面创建好的user表对id字段创建名字为user_index,索引存储在user_index_table索引表中 代码语言:javascript 复制 create index user_index on tableuser(id)as'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler'withdeferred rebuildintable user_index_table; ...
在 emp 表上针对 empno 字段创建名为 emp_index,索引数据存储在 emp_index_table 索引表中 create index emp_index on table emp(empno) as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild in table emp_index_table ;此时索引表中是没有数据的,需要重建索引才会有...
as ‘index.handler.class.name’ 指定索引处理器,这里的一般使用org.apache.hadoop.hive.ql.index.compact.compactindexhandler 这个处理器。[with deferred rebuild] 表明创建一个空索引,也就是说现在还不创建索引 [in table index_table_name] 索引存储在哪个表中。[idxproperties (property_name=property_value,...