{"id":4782,"date":"2015-03-24T09:38:36","date_gmt":"2015-03-24T14:38:36","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=4782"},"modified":"2015-03-24T09:38:36","modified_gmt":"2015-03-24T14:38:36","slug":"hive-transactions","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2015\/03\/24\/hive-transactions\/","title":{"rendered":"Hive transactions"},"content":{"rendered":"<p>Below is just a simple example of hive transactions.  These are very useful on slowly changing type 1 dimension tables for which you do not wish to retain history, but only the most recent value of the row.  The table must be bucketed, and the transactional=true property must be set on the table as shown below.<\/p>\n<pre>\r\n0: jdbc:hive2:\/\/localhost:10000\/brierley> create table t(c int)   clustered by (c) into 10 buckets stored as orc tblproperties('transactional'='true');\r\nNo rows affected (0.077 seconds)\r\n0: jdbc:hive2:\/\/localhost:10000\/brierley> insert into table t values(1);\r\nINFO  : Tez session hasn't been created yet. Opening session\r\n<\/pre>\n<p>&#8230;snip&#8230;<\/p>\n<pre>\r\nINFO  :\r\nINFO  : Table brierley.t stats: [numFiles=11, numRows=1, totalSize=2871, rawDataSize=0]\r\n0: jdbc:hive2:\/\/localhost:10000\/brierley> select * from t;\r\n+------+--+\r\n| t.c  |\r\n+------+--+\r\n| 2    |\r\n+------+--+\r\n1 row selected (0.172 seconds)\r\n0: jdbc:hive2:\/\/localhost:10000\/brierley>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Below is just a simple example of hive transactions. These are very useful on slowly changing type 1 dimension tables for which you do not wish to retain history, but only the most recent value of the row. The table&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2015\/03\/24\/hive-transactions\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[43],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/4782"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=4782"}],"version-history":[{"count":4,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/4782\/revisions"}],"predecessor-version":[{"id":4792,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/4782\/revisions\/4792"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=4782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=4782"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=4782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}