hive比较坑的一点就是没有类似hive -version
的方便地查看版本的方法,我们只能自己去hive的安装目录里去看各个jar包的版本。可是,我们怎么找到hive的安装目录呢?
这里有个方便的方法:
$ locate */hive/lib/hive*jar
这样可以方便地定位到hive/lib目录下查看各个jar包的版本
通常,hive-exec的那个jar包的版本就是hive的版本号
比如我这里:
[dev@rmdata2 ~]$ locate */hive/lib/hive*jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-accumulo-handler-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-accumulo-handler.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-ant-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-ant.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-beeline-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-beeline.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-cli-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-cli.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-common-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-common.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-contrib-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-contrib.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-exec-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-exec.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-hbase-handler-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-hbase-handler.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-hwi-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-hwi.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-jdbc-1.1.0-cdh5.8.0-standalone.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-jdbc-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-jdbc-standalone.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-jdbc.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-metastore-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-metastore.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-serde-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-serde.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-service-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-service.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims-0.23-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims-0.23.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims-common-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims-common.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims-scheduler-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims-scheduler.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-shims.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-testutils-1.1.0-cdh5.8.0.jar
/opt/cloudera/parcels/cdh-5.8.0-1.cdh5.8.0.p0.42/lib/hive/lib/hive-testutils.jar
可以看到我的hive的版本为1.1.0