{"id":4759,"date":"2019-09-02T10:32:41","date_gmt":"2019-09-02T14:32:41","guid":{"rendered":"https:\/\/microdevsys.com\/wp\/?p=4759"},"modified":"2019-09-02T10:32:41","modified_gmt":"2019-09-02T14:32:41","slug":"how-do-i-connect-to-hiveserver2-hs2-through-beeline","status":"publish","type":"post","link":"https:\/\/microdevsys.com\/wp\/how-do-i-connect-to-hiveserver2-hs2-through-beeline\/","title":{"rendered":"How do I connect to HiveServer2 (HS2) through beeline"},"content":{"rendered":"<p>\n\tHow do I connect to HiveServer2 (HS2) through beeline:\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\"><strong>beeline&gt; !connect jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/default;principal=hive\/cm-r01en01.mws.mds.xyz@MWS.MDS.XYZ<\/strong><br \/>\n\tConnecting to jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/default;principal=hive\/cm-r01en01.mws.mds.xyz@MWS.MDS.XYZ<br \/>\n\tConnected to: Apache Hive (version 2.1.1-cdh6.3.0)<br \/>\n\tDriver: Hive JDBC (version 2.1.1-cdh6.3.0)<br \/>\n\tTransaction isolation: TRANSACTION_REPEATABLE_READ<br \/>\n\t0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt;<br \/>\n\t0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt;<br \/>\n\t0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt; show tables;<br \/>\n\tINFO &nbsp;: Compiling command(queryId=hive_20190902102937_4ef97c5b-19ff-47b8-be81-dacb2edeece0): show tables<br \/>\n\tINFO &nbsp;: Semantic Analysis Completed<br \/>\n\tINFO &nbsp;: Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)<br \/>\n\tINFO &nbsp;: Completed compiling command(queryId=hive_20190902102937_4ef97c5b-19ff-47b8-be81-dacb2edeece0); Time taken: 2.67 seconds<br \/>\n\tINFO &nbsp;: Executing command(queryId=hive_20190902102937_4ef97c5b-19ff-47b8-be81-dacb2edeece0): show tables<br \/>\n\tINFO &nbsp;: Starting task [Stage-0:DDL] in serial mode<br \/>\n\tINFO &nbsp;: Completed executing command(queryId=hive_20190902102937_4ef97c5b-19ff-47b8-be81-dacb2edeece0); Time taken: 1.333 seconds<br \/>\n\tINFO &nbsp;: OK<br \/>\n\t+&#8212;&#8212;&#8212;&#8211;+<br \/>\n\t| tab_name &nbsp;|<br \/>\n\t+&#8212;&#8212;&#8212;&#8211;+<br \/>\n\t+&#8212;&#8212;&#8212;&#8211;+<br \/>\n\tNo rows selected (5.048 seconds)<br \/>\n\t0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt; show databases;<br \/>\n\tINFO &nbsp;: Compiling command(queryId=hive_20190902103034_18cb927f-0ab7-4a2d-b311-206b6ebb2cc2): show databases<br \/>\n\tINFO &nbsp;: Semantic Analysis Completed<br \/>\n\tINFO &nbsp;: Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)<br \/>\n\tINFO &nbsp;: Completed compiling command(queryId=hive_20190902103034_18cb927f-0ab7-4a2d-b311-206b6ebb2cc2); Time taken: 0.059 seconds<br \/>\n\tINFO &nbsp;: Executing command(queryId=hive_20190902103034_18cb927f-0ab7-4a2d-b311-206b6ebb2cc2): show databases<br \/>\n\tINFO &nbsp;: Starting task [Stage-0:DDL] in serial mode<br \/>\n\tINFO &nbsp;: Completed executing command(queryId=hive_20190902103034_18cb927f-0ab7-4a2d-b311-206b6ebb2cc2); Time taken: 0.039 seconds<br \/>\n\tINFO &nbsp;: OK<br \/>\n\t+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n\t| database_name &nbsp;|<br \/>\n\t+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n\t| default &nbsp; &nbsp; &nbsp; &nbsp;|<br \/>\n\t+&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n\t1 row selected (0.362 seconds)<br \/>\n\t0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt;<\/span><br \/>\n\t&nbsp;\n<\/p>\n<p>\n\tCheers,<br \/>\n\tTK<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>How do I connect to HiveServer2 (HS2) through beeline: beeline&gt; !connect jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/default;principal=hive\/cm-r01en01.mws.mds.xyz@MWS.MDS.XYZ Connecting to jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/default;principal=hive\/cm-r01en01.mws.mds.xyz@MWS.MDS.XYZ Connected to: Apache Hive (version 2.1.1-cdh6.3.0) Driver: Hive JDBC (version 2.1.1-cdh6.3.0) Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt; 0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt; 0: jdbc:hive2:\/\/cm-r01en01.mws.mds.xyz:10000\/&gt; show tables; INFO &nbsp;: Compiling command(queryId=hive_20190902102937_4ef97c5b-19ff-47b8-be81-dacb2edeece0): show tables INFO &nbsp;: Semantic Analysis Completed INFO &nbsp;: Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4759","post","type-post","status-publish","format-standard","hentry","category-unix-linux-admin-stuff"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/4759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/comments?post=4759"}],"version-history":[{"count":1,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/4759\/revisions"}],"predecessor-version":[{"id":4760,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/4759\/revisions\/4760"}],"wp:attachment":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/media?parent=4759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/categories?post=4759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/tags?post=4759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}