{"id":10354,"date":"2022-08-23T16:22:37","date_gmt":"2022-08-23T08:22:37","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=10354"},"modified":"2022-08-24T08:19:21","modified_gmt":"2022-08-24T00:19:21","slug":"gbase-8a%e5%b0%86hash%e5%88%86%e5%b8%83%e8%a1%a8%e8%bd%ac%e6%88%90%e9%9a%8f%e6%9c%ba%e5%88%86%e5%b8%83%e8%a1%a8%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/10354","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u5c06Hash\u5206\u5e03\u8868\u8f6c\u6210\u968f\u673a\u5206\u5e03\u8868\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecd\u51e0\u79cd\uff0c\u5c06GBase 8a\u7684Hash\u5206\u5e03\u8868\u8f6c\u6362\u4e3a\u968f\u673a\u5206\u5e03\u8868\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2ab841d3bec\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2ab841d3bec\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/10354\/#%E7%8E%AF%E5%A2%83\" >\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/10354\/#%E9%87%8D%E5%BB%BA%E8%A1%A8\" >\u91cd\u5efa\u8868<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/10354\/#%E5%88%A0%E9%99%A4hash%E5%88%97%E5%85%B3%E9%94%AE%E5%AD%97\" >\u5220\u9664hash\u5217\u5173\u952e\u5b57<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%8E%AF%E5%A2%83\"><\/span>\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4e00\u5f20id\u4e3a\u5206\u5e03\u5217\u7684hash\u5206\u5e03\u8868\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase&gt; create table t_hash(id int, name varchar(100))distributed by('id');\nQuery OK, 0 rows affected (Elapsed: 00:00:00.66)\n\ngbase&gt; show create table t_hash;\n+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Table  | Create Table                                                                                                                                                                   |\n+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| t_hash | CREATE TABLE \"t_hash\" (\n  \"id\" int(11) DEFAULT NULL,\n  \"name\" varchar(100) DEFAULT NULL\n) ENGINE=EXPRESS DISTRIBUTED BY('id') DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' |\n+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%87%8D%E5%BB%BA%E8%A1%A8\"><\/span>\u91cd\u5efa\u8868<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u8be5\u65b9\u6cd5\u9002\u5408\u6240\u6709\u7248\u672c\uff0c\u65e0\u4efb\u4f55\u98ce\u9669\u3002<\/p>\n\n\n\n<p>\u65b0\u5efa\u4e00\u5f20\u8868\uff0c\u8868\u7ed3\u6784\u4e0ehash\u5206\u5e03\u8868\u4e00\u6837\uff0c\u4f46\u53bb\u6389hash\u5206\u5e03\u5217<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create table t_nohash(id int, name varchar(100));\ninsert into t_nohash select * from t_hash;\nrename table t_hash to t_hash_BAK;\nreanem table t_nohash to t_hash ;<\/code><\/pre>\n\n\n\n<p>\u5982\u4e0a\u7684rename\u64cd\u4f5c\u786e\u8ba4\u6240\u6709\u4e1a\u52a1\u6b63\u5e38\u540e\uff0c\u53ef\u4ee5\u8003\u8651\u5220\u9664t_hash_BAK\u8868\u4ee5\u4fbf\u8282\u7701\u7a7a\u95f4\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%88%A0%E9%99%A4hash%E5%88%97%E5%85%B3%E9%94%AE%E5%AD%97\"><\/span>\u5220\u9664hash\u5217\u5173\u952e\u5b57<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u8be5\u65b9\u6cd5\u57289.5\u7684\u624b\u518c\u91cc\u51fa\u73b0\uff0c86\u672a\u6ce8\u610f\uff0c\u4f46\u9884\u8ba1\u80fd\u7528\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase&gt; drop distributed column on t_hash;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.02)\n\ngbase&gt; show create table t_hash;\n+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Table  | Create Table                                                                                                                                              |\n+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+\n| t_hash | CREATE TABLE \"t_hash\" (\n  \"id\" int(11) DEFAULT NULL,\n  \"name\" varchar(100) DEFAULT NULL\n) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' |\n+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecd\u51e0\u79cd\uff0c\u5c06GBase 8a\u7684Hash\u5206\u5e03\u8868\u8f6c\u6362\u4e3a\u968f\u673a\u5206\u5e03\u8868\u7684\u65b9\u6cd5<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-10354","post","type-post","status-publish","format-standard","hentry","category-gbase8a"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/10354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=10354"}],"version-history":[{"count":9,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/10354\/revisions"}],"predecessor-version":[{"id":10370,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/10354\/revisions\/10370"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=10354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=10354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=10354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}