{"id":7816,"date":"2021-12-30T19:43:16","date_gmt":"2021-12-30T19:43:16","guid":{"rendered":"https:\/\/www.npntraining.com\/blog\/?p=7816"},"modified":"2022-01-02T07:40:57","modified_gmt":"2022-01-02T07:40:57","slug":"configure-sql-workbench-and-query-hive","status":"publish","type":"post","link":"https:\/\/www.npntraining.com\/blog\/configure-sql-workbench-and-query-hive\/","title":{"rendered":"Configure SQL Workbench and Query Hive"},"content":{"rendered":"<p>In this blog post, I will show you how to connect to Hive using SQL Workbench.<\/p>\n<h2>Download the SQL Workbench and Drivers<\/h2>\n<h2>Configure Drivers<\/h2>\n<ul>\n<li>Launch SQLWorkbench64.exe<\/li>\n<li>Click on Manage Driver<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.npntraining.com\/blog\/wp-content\/uploads\/2021\/12\/image-20211230235333668.png\" alt=\"\" \/><\/p>\n<ul>\n<li>Click on <strong>Create New Entry Icon<\/strong> in the top left<\/li>\n<li>Click on the icon and select all the jars present in the directory <em>\\Workbench-Build127\\AmazonHiveJDBC-1.0.9.1060<\/em><\/li>\n<li>Enter the Classname as : <em>com.amazon.hive.jdbc41.HS2Driver<\/em><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.npntraining.com\/blog\/wp-content\/uploads\/2021\/12\/image-20211230235434418.png\" alt=\"\" \/><\/p>\n<ul>\n<li>Press OK<\/li>\n<\/ul>\n<h2>Configure Connection Profile<\/h2>\n<ul>\n<li>Configure the setting as shown below.<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.npntraining.com\/blog\/wp-content\/uploads\/2021\/12\/image-20211231000123847.png\" alt=\"\" \/><\/p>\n<ul>\n<li>Click on SSH and Configure the settings as shown below.<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.npntraining.com\/blog\/wp-content\/uploads\/2021\/12\/image-20211231000237990.png\" alt=\"\" \/><\/p>\n<ul>\n<li>Select the .pem key which have created via EC2 Key Pairs.<\/li>\n<li>Click ok<\/li>\n<\/ul>\n<h2>Create Table in Hive<\/h2>\n<pre><code>CREATE EXTERNAL TABLE users\n    (user_id   BIGINT,\n    name  STRING,\n    age BIGINT\n    )\nSTORED BY &#039;org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler&#039;\nTBLPROPERTIES(\n    &quot;dynamodb.table.name&quot; = &quot;users&quot;,\n    &quot;dynamodb.column.mapping&quot;=&quot;user_id:user_id,name:name,age:age&quot;\n);\n\ninsert into users values(1,&#039;naveen&#039;,35);<\/code><\/pre>\n<ul>\n<li>Go to DyanmoDB and you can see the data<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, I will show you how to connect to Hive using SQL Workbench. Download the SQL Workbench and Drivers Configure Drivers Launch SQLWorkbench64.exe Click on Manage Driver&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,56],"tags":[],"class_list":["post-7816","post","type-post","status-publish","format-standard","hentry","category-aws","category-cloud-computing"],"_links":{"self":[{"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/posts\/7816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/comments?post=7816"}],"version-history":[{"count":4,"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/posts\/7816\/revisions"}],"predecessor-version":[{"id":7824,"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/posts\/7816\/revisions\/7824"}],"wp:attachment":[{"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/media?parent=7816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/categories?post=7816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.npntraining.com\/blog\/wp-json\/wp\/v2\/tags?post=7816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}