i'm trying to execute a query in a test.hql with beeline and i'm not getting results
here the command :
beeline -u "jdbc:hive2://master01:2181,master02:2181,master03:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" -f test.hql
in test.hql file :
select * from db1.tab1 limit 20;
But if i execute the command with the parameter -e which execute directly the query,it gives me the results
beeline -u "jdbc:hive2://master01:2181,master02:2181,master03:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" -e "select * from db1.tab1 limit 20;"
Am i missing something ?
You're right.
-eis used to execute one or multiple queries and see the result.-fis mostly used to run scripts likeinsert into mytab select * from ourtab;where you dont need to see all the rows.For more options you can check- https://cwiki.apache.org/confluence/display/hive/hiveserver2+clients#HiveServer2Clients-BeelineHiveCommands