How to query external hive Metastore From Spark

Table of contents
Reading Time: < 1 minute

In this Blog we will learn how can we access tables from hive metastore in spark,so now just lets get started

  • start your hive metastore as  as service with following command
  • hive –service metastore by default it will start metastore on port 9083

Screenshot from 2017-10-24 20-47-58.png

  • go to your spark client and tell driver to conncet to metastore listening on port 9083  when starting the hive thrift server with following command
  • $SPARK_HOME/sbin/start-thriftserver.sh –driver-java-options “-Dhive.metastore.uris=thrift://localhost:9083”

Screenshot from 2017-10-24 20-53-28.png
as you can see show tables show all the tables that are in hive metastore now they are available to spark-client

i hope this blog will help


knoldus-advt-sticker


 

1 thought on “How to query external hive Metastore From Spark1 min read

Comments are closed.