本文主要整理一下 impala 每个版本的新特性,方便了解 impala 做了哪些改进、修复了哪些 bug。
不得不说的事情:
1.3.1 用于 cdh4
1.4.0 用于 cdh5
cdh5 中,impala 可以使用 hdfs 缓存特性加快频繁访问的数据的速度,减少 cpu 使用率。当数据缓存到 hdfs cache 中时,impala 可以直接从缓存中读取数据而不需要读磁盘并且减少额外的内存拷贝。
<a href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/cdh5/latest/cdh5-installation-guide/cdh5ig_hdfs_caching.html" target="_blank">centralized cache management in hdfs</a>
增加以下内建函数:
<code>add_months()</code>
<code>max_int()</code>、<code>min_smallint()</code>等,用于判断数组是否超过最大值和最小值。
<code>is_inf()</code> 和 <code>is_nan()</code>,用于判断是否为数值。
<code>compute stats</code> 语句性能改进:
<code>ndv</code> 函数通过生成本地代码加快速度
impala-shell 支持 utf-8 字符的输入和输出,可以通过参数 <code>--strict_unicode</code> 控制是否忽略不合法的 unicode 字符。
该版本主要是 bug 修复,可以在 cdh 4 和 cdh 5 中使用。
<a href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/impala/latest/installing-and-using-impala/ciiu_admission.html#admission_control" target="_blank">admission control and query queuing</a>
<code>unix_timestamp</code> 、<code>from_unixtime</code> 和 <code>interval</code>
该版本用于 cdh4,主要针对 1.2.3 做了一些 bug 修复。
增加 <code>invalidate metadata table_name</code> 语法刷新新建的一个表
添加 catalogd 启动参数:
<code>--load_catalog_in_background</code>,是否后台运行
<code>--num_metadata_loading_threads</code>,并行加载线程
impala 1.2.3 works with cdh 4 and with cdh 5 beta 2. the resource management feature requires cdh 5 beta.
impala 1.2.2 works with cdh 4. its feature set is a superset of features in the impala 1.2.0 beta, with the exception of resource management, which relies on cdh 5.
<code>compute stats</code>
ldap 支持
<code>insert</code> 语句可以添加 <code>shuffle</code> 或者 <code>noshuffle</code>,主要是用在插入数据到 parquet 表的分区的时候。
添加 <code>cast()</code> 用于类型转换
支持 <code>stored as parquet</code> 语句。
添加 <code>show table stats table_name</code> 和 <code>show column stats table_name</code> 语法
添加 <code>create table as select</code> 语法
支持 <code>offset</code> 语句,用于分页查询
<code>order by</code> 语句中添加 <code>nulls first</code> 和 <code>nulls last</code> 语法支持
添加 <code>ndv()</code> 函数来计算 <code>count(distinct col)</code>
<code>limit</code> 语句接受数值表达式作为参数
<code>show create table</code>
添加 <code>create table ... as select</code> 语法
<code>explain</code>
<code>limit</code> 语句支持算术表达式