select * from p limit 10;
select count(*) from p;
那么我们可以用下面的命令来查询: [wyp@wyp hive-0.11.0-bin]$ bin/hive -f test
........这里省略了一些输出...........
OK
196242388125094920131102jx
186302389171774220131102jx
22377187888711620131102jx
24451288060692320131102jx
166346188639759620131102jx
298474488418280620131102jx
115265288117148820131102jx
253465589162846720131102jx
305451388632481720131102jx
686388360301320131102jx
Time taken: 4.386 seconds, Fetched: 10 row(s)
........这里省略了一些输出...........
OK
4000000
Time taken: 16.284 seconds, Fetched: 1 row(s)
如果你配置好了Hive shell的路径,你可以用SOURCE命令来运行那个查询文件: [wyp@wyp hive-0.11.0-bin]$ hive
hive> source /home/wyp/Documents/test;
........这里省略了一些输出...........
OK
196242388125094920131102jx
186302389171774220131102jx
22377187888711620131102jx
24451288060692320131102jx
166346188639759620131102jx
298474488418280620131102jx
115265288117148820131102jx
253465589162846720131102jx
305451388632481720131102jx
686388360301320131102jx
Time taken: 4.386 seconds, Fetched: 10 row(s)
........这里省略了一些输出...........
OK
4000000
Time taken: 16.284 seconds, Fetched: 1 row(s)