hadoop - 索引如何在配置单元内部工作?

标签 hadoop hive bigdata

索引不过是表中特定列的指针。创建索引意味着在表的特定列上创建指针。如果一个列在表中被索引,以及该特定列的数据是如何指向的,当查询该特定列时?

最佳答案

来自文档

The goal of Hive indexing is to improve the speed of query lookup on certain columns of a table. Without an index, queries with predicates like 'WHERE tab1.col1 = 10' load the entire table or partition and process all the rows. But if an index exists for col1, then only a portion of the file needs to be loaded and processed. The improvement in query speed that an index can provide comes at the cost of additional processing to create the index and disk space to store the index.

在幕后,Hive 本质上创建了一个 Map,其中包含它正在索引的列的值以及数据在 HDFS 中的偏移量 + 文件所在的位置,这样,Hive 不需要扫描所有数据以搜索某个值。这是一篇解释基本概念的好文章

https://acadgild.com/blog/indexing-in-hive/

关于hadoop - 索引如何在配置单元内部工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47674194/

相关文章:

hadoop - 在reduce任务中调用htable.get(rowID)对于随机行返回NULL

mysql - NoSql 类型的解决方案在分布式时如何支持一致性?

mysql - Hadoop 与关系数据库

python - 将 python 连接到 Hive

hadoop - 无法在hbase中正确插入列

sql - Hive时间戳转换问题

hadoop - 为什么使用 MapReduce 与 HBase shell 过滤器

mysql - 如何根据 Hive 中的用户名和最大日期从两个表中检索完整数据

r - 大稀疏矩阵到三角矩阵 R

python - Spark KMeans 无法处理大数据吗?