下面只是一个例子,一般用OR 条件肯定会搞定的。
SELECT a, b from tb1 where a > 100
UNION
SELECT a, b from tb2 where a > 1000;
会报错 FAILED: SemanticException 1:62 Top level UNION is not supported currently; use a subquery for the UNION. Error encountered[......]
下面只是一个例子,一般用OR 条件肯定会搞定的。
SELECT a, b from tb1 where a > 100
UNION
SELECT a, b from tb2 where a > 1000;
会报错 FAILED: SemanticException 1:62 Top level UNION is not supported currently; use a subquery for the UNION. Error encountered[......]
hive默认使用的derby的嵌入模式。这个就面临着,无法多个并发hive shell共享的问题。
使用MySQL服务器也可以解决问题,但安装、配置太麻烦了。
可以使用轻量级的derby的c/s服务模式解决问题。
1、下载、配置derby
首先,从apache下载derby的最新版。
wget http://apache.mirrors.pair.com//db/derby/db-derby-10.10.1.1/db-derby-10.10.1.1-bin.tar.gz[......]
关于在hadoop中,如何让reduce阶段同一个key下的values有序,一篇很好的文章,写的比《Hadoop权威指南》清楚!
转载自:
http://www.bigdataspeak.com/2013/02/hadoop-how-to-do-secondary-sort-on_25.html
The problem at hand here is that you need to work upon a sorted values set in your reducer.[......]
1、表操作
添加表
create 'table_name','family'
删除表
disable 'table_name'
drop 'table_name'
添加column family
alter 'table_name', {NAME => 'cf_new'}
查看表结构
describe 'table_name'[......]
与Hadoop一样,HBase也有三种运行模式:Standalone, Distributed, Pseudo-distributed。
其中,Pseudo-distributed称为伪集群模式,与Distributed基本一样,只不过进程都运行在一台机器上。
1、对HDFS配置伪集群模式。
2、配置HBase
hbase-site.xml
<?xml version="1.0"[......]