{"id":1320,"date":"2022-03-05T10:58:25","date_gmt":"2022-03-05T02:58:25","guid":{"rendered":"http:\/\/www.eait.co\/?p=1320"},"modified":"2022-03-05T10:58:25","modified_gmt":"2022-03-05T02:58:25","slug":"hive%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/notes.coremix.net\/?p=1320","title":{"rendered":"Hive\u6570\u636e\u7c7b\u578b"},"content":{"rendered":"<h2>3.1 \u57fa\u672c\u6570\u636e\u7c7b\u578b<\/h2>\n<table>\n<tbody>\n<tr>\n<td width=\"152\">Hive\u6570\u636e\u7c7b\u578b<\/td>\n<td width=\"130\">Java\u6570\u636e\u7c7b\u578b<\/td>\n<td width=\"140\">\u957f\u5ea6<\/td>\n<td width=\"137\">\u4f8b\u5b50<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">TINYINT<\/td>\n<td width=\"130\">byte<\/td>\n<td width=\"140\">1byte\u6709\u7b26\u53f7\u6574\u6570<\/td>\n<td width=\"137\">20<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">SMALINT<\/td>\n<td width=\"130\">short<\/td>\n<td width=\"140\">2byte\u6709\u7b26\u53f7\u6574\u6570<\/td>\n<td width=\"137\">20<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">INT<\/td>\n<td width=\"130\">int<\/td>\n<td width=\"140\">4byte\u6709\u7b26\u53f7\u6574\u6570<\/td>\n<td width=\"137\">20<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">BIGINT<\/td>\n<td width=\"130\">long<\/td>\n<td width=\"140\">8byte\u6709\u7b26\u53f7\u6574\u6570<\/td>\n<td width=\"137\">20<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">BOOLEAN<\/td>\n<td width=\"130\">boolean<\/td>\n<td width=\"140\">\u5e03\u5c14\u7c7b\u578b\uff0ctrue\u6216\u8005false<\/td>\n<td width=\"137\">TRUE\u00a0 FALSE<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">FLOAT<\/td>\n<td width=\"130\">float<\/td>\n<td width=\"140\">\u5355\u7cbe\u5ea6\u6d6e\u70b9\u6570<\/td>\n<td width=\"137\">3.14159<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">DOUBLE<\/td>\n<td width=\"130\">double<\/td>\n<td width=\"140\">\u53cc\u7cbe\u5ea6\u6d6e\u70b9\u6570<\/td>\n<td width=\"137\">3.14159<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">STRING<\/td>\n<td width=\"130\">string<\/td>\n<td width=\"140\">\u5b57\u7b26\u7cfb\u5217\u3002\u53ef\u4ee5\u6307\u5b9a\u5b57\u7b26\u96c6\u3002\u53ef\u4ee5\u4f7f\u7528\u5355\u5f15\u53f7\u6216\u8005\u53cc\u5f15\u53f7\u3002<\/td>\n<td width=\"137\">\u2018now is the time\u2019 \u201cfor all good men\u201d<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">TIMESTAMP<\/td>\n<td width=\"130\">&nbsp;<\/td>\n<td width=\"140\">\u65f6\u95f4\u7c7b\u578b<\/td>\n<td width=\"137\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">BINARY<\/td>\n<td width=\"130\">&nbsp;<\/td>\n<td width=\"140\">\u5b57\u8282\u6570\u7ec4<\/td>\n<td width=\"137\">&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5bf9\u4e8eHive\u7684String\u7c7b\u578b\u76f8\u5f53\u4e8e\u6570\u636e\u5e93\u7684varchar\u7c7b\u578b\uff0c\u8be5\u7c7b\u578b\u662f\u4e00\u4e2a\u53ef\u53d8\u7684\u5b57\u7b26\u4e32\uff0c\u4e0d\u8fc7\u5b83\u4e0d\u80fd\u6307\u5b9a\u5176\u4e2d\u6700\u591a\u80fd\u5b58\u50a8\u591a\u5c11\u4e2a\u5b57\u7b26\uff0c\u7406\u8bba\u4e0a\u5b83\u53ef\u4ee5\u5b58\u50a82GB\u7684\u5b57\u7b26\u6570\u3002<\/p>\n<h2>3.2 \u96c6\u5408\u6570\u636e\u7c7b\u578b<\/h2>\n<table>\n<tbody>\n<tr>\n<td width=\"104\">\u6570\u636e\u7c7b\u578b<\/td>\n<td width=\"267\">\u63cf\u8ff0<\/td>\n<td width=\"176\">\u8bed\u6cd5\u793a\u4f8b<\/td>\n<\/tr>\n<tr>\n<td width=\"104\">STRUCT<\/td>\n<td width=\"267\">\u548cc\u8bed\u8a00\u4e2d\u7684struct\u7c7b\u4f3c\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u201c\u70b9\u201d\u7b26\u53f7\u8bbf\u95ee\u5143\u7d20\u5185\u5bb9\u3002\u4f8b\u5982\uff0c\u5982\u679c\u67d0\u4e2a\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fSTRUCT{first STRING, last STRING},\u90a3\u4e48\u7b2c1\u4e2a\u5143\u7d20\u53ef\u4ee5\u901a\u8fc7\u5b57\u6bb5.first\u6765\u5f15\u7528\u3002<\/td>\n<td width=\"176\">struct()<\/td>\n<\/tr>\n<tr>\n<td width=\"104\">MAP<\/td>\n<td width=\"267\">MAP\u662f\u4e00\u7ec4\u952e-\u503c\u5bf9\u5143\u7ec4\u96c6\u5408\uff0c\u4f7f\u7528\u6570\u7ec4\u8868\u793a\u6cd5\u53ef\u4ee5\u8bbf\u95ee\u6570\u636e\u3002\u4f8b\u5982\uff0c\u5982\u679c\u67d0\u4e2a\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fMAP\uff0c\u5176\u4e2d\u952e-&gt;\u503c\u5bf9\u662f\u2019first\u2019-&gt;\u2019John\u2019\u548c\u2019last\u2019-&gt;\u2019Doe\u2019\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u5b57\u6bb5\u540d[\u2018last\u2019]\u83b7\u53d6\u6700\u540e\u4e00\u4e2a\u5143\u7d20<\/td>\n<td width=\"176\">map()<\/td>\n<\/tr>\n<tr>\n<td width=\"104\">ARRAY<\/td>\n<td width=\"267\">\u6570\u7ec4\u662f\u4e00\u7ec4\u5177\u6709\u76f8\u540c\u7c7b\u578b\u548c\u540d\u79f0\u7684\u53d8\u91cf\u7684\u96c6\u5408\u3002\u8fd9\u4e9b\u53d8\u91cf\u79f0\u4e3a\u6570\u7ec4\u7684\u5143\u7d20\uff0c\u6bcf\u4e2a\u6570\u7ec4\u5143\u7d20\u90fd\u6709\u4e00\u4e2a\u7f16\u53f7\uff0c\u7f16\u53f7\u4ece\u96f6\u5f00\u59cb\u3002\u4f8b\u5982\uff0c\u6570\u7ec4\u503c\u4e3a[\u2018John\u2019, \u2018Doe\u2019]\uff0c\u90a3\u4e48\u7b2c2\u4e2a\u5143\u7d20\u53ef\u4ee5\u901a\u8fc7\u6570\u7ec4\u540d[1]\u8fdb\u884c\u5f15\u7528\u3002<\/td>\n<td width=\"176\">Array()<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Hive\u6709\u4e09\u79cd\u590d\u6742\u6570\u636e\u7c7b\u578bARRAY\u3001MAP \u548c STRUCT\u3002ARRAY\u548cMAP\u4e0eJava\u4e2d\u7684Array\u548cMap\u7c7b\u4f3c\uff0c\u800cSTRUCT\u4e0eC\u8bed\u8a00\u4e2d\u7684Struct\u7c7b\u4f3c\uff0c\u5b83\u5c01\u88c5\u4e86\u4e00\u4e2a\u547d\u540d\u5b57\u6bb5\u96c6\u5408\uff0c\u590d\u6742\u6570\u636e\u7c7b\u578b\u5141\u8bb8\u4efb\u610f\u5c42\u6b21\u7684\u5d4c\u5957\u3002<\/p>\n<h2>3.2 \u96c6\u5408\u6570\u636e\u7c7b\u578b<\/h2>\n<table style=\"height: 621px;\">\n<tbody>\n<tr style=\"height: 40px;\">\n<td style=\"height: 40px; width: 104px;\">\u6570\u636e\u7c7b\u578b<\/td>\n<td style=\"height: 40px; width: 267px;\">\u63cf\u8ff0<\/td>\n<td style=\"height: 40px; width: 176px;\">\u8bed\u6cd5\u793a\u4f8b<\/td>\n<\/tr>\n<tr style=\"height: 184px;\">\n<td style=\"height: 184px; width: 104px;\">STRUCT<\/td>\n<td style=\"height: 184px; width: 267px;\">\u548cc\u8bed\u8a00\u4e2d\u7684struct\u7c7b\u4f3c\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u201c\u70b9\u201d\u7b26\u53f7\u8bbf\u95ee\u5143\u7d20\u5185\u5bb9\u3002\u4f8b\u5982\uff0c\u5982\u679c\u67d0\u4e2a\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fSTRUCT{first STRING, last STRING},\u90a3\u4e48\u7b2c1\u4e2a\u5143\u7d20\u53ef\u4ee5\u901a\u8fc7\u5b57\u6bb5.first\u6765\u5f15\u7528\u3002\u00a0 \u00a0 \u00a0<span style=\"color: #ff0000;\">\uff08\u7c7b\uff09<\/span><\/td>\n<td style=\"height: 184px; width: 176px;\">struct()<\/td>\n<\/tr>\n<tr style=\"height: 213px;\">\n<td style=\"height: 213px; width: 104px;\">MAP<\/td>\n<td style=\"height: 213px; width: 267px;\">MAP\u662f\u4e00\u7ec4\u952e-\u503c\u5bf9\u5143\u7ec4\u96c6\u5408\uff0c\u4f7f\u7528\u6570\u7ec4\u8868\u793a\u6cd5\u53ef\u4ee5\u8bbf\u95ee\u6570\u636e\u3002\u4f8b\u5982\uff0c\u5982\u679c\u67d0\u4e2a\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fMAP\uff0c\u5176\u4e2d\u952e-&gt;\u503c\u5bf9\u662f\u2019first\u2019-&gt;\u2019John\u2019\u548c\u2019last\u2019-&gt;\u2019Doe\u2019\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u5b57\u6bb5\u540d[\u2018last\u2019]\u83b7\u53d6\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u00a0 \u00a0 \u00a0<span style=\"color: #ff0000;\">(\u5b57\u5178)<\/span><\/td>\n<td style=\"height: 213px; width: 176px;\">map()<\/td>\n<\/tr>\n<tr style=\"height: 184px;\">\n<td style=\"height: 184px; width: 104px;\">ARRAY<\/td>\n<td style=\"height: 184px; width: 267px;\">\u6570\u7ec4\u662f\u4e00\u7ec4\u5177\u6709\u76f8\u540c\u7c7b\u578b\u548c\u540d\u79f0\u7684\u53d8\u91cf\u7684\u96c6\u5408\u3002\u8fd9\u4e9b\u53d8\u91cf\u79f0\u4e3a\u6570\u7ec4\u7684\u5143\u7d20\uff0c\u6bcf\u4e2a\u6570\u7ec4\u5143\u7d20\u90fd\u6709\u4e00\u4e2a\u7f16\u53f7\uff0c\u7f16\u53f7\u4ece\u96f6\u5f00\u59cb\u3002\u4f8b\u5982\uff0c\u6570\u7ec4\u503c\u4e3a[\u2018John\u2019, \u2018Doe\u2019]\uff0c\u90a3\u4e48\u7b2c2\u4e2a\u5143\u7d20\u53ef\u4ee5\u901a\u8fc7\u6570\u7ec4\u540d[1]\u8fdb\u884c\u5f15\u7528\u3002<\/td>\n<td style=\"height: 184px; width: 176px;\">Array()<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Hive\u6709\u4e09\u79cd\u590d\u6742\u6570\u636e\u7c7b\u578bARRAY\u3001MAP \u548c STRUCT\u3002ARRAY\u548cMAP\u4e0eJava\u4e2d\u7684Array\u548cMap\u7c7b\u4f3c\uff0c\u800cSTRUCT\u4e0eC\u8bed\u8a00\u4e2d\u7684Struct\u7c7b\u4f3c\uff0c\u5b83\u5c01\u88c5\u4e86\u4e00\u4e2a\u547d\u540d\u5b57\u6bb5\u96c6\u5408\uff0c\u590d\u6742\u6570\u636e\u7c7b\u578b\u5141\u8bb8\u4efb\u610f\u5c42\u6b21\u7684\u5d4c\u5957\u3002<\/p>\n<p>\u6848\u4f8b\u5b9e\u64cd<\/p>\n<p>1\uff09\u5047\u8bbe\u67d0\u8868\u6709\u5982\u4e0b\u4e00\u884c\uff0c\u6211\u4eec\u7528JSON\u683c\u5f0f\u6765\u8868\u793a\u5176\u6570\u636e\u7ed3\u6784\u3002\u5728Hive\u4e0b\u8bbf\u95ee\u7684\u683c\u5f0f\u4e3a<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"548\">{<\/p>\n<p>&#8220;name&#8221;: &#8220;songsong&#8221;,<\/p>\n<p>&#8220;friends&#8221;: [&#8220;bingbing&#8221; , &#8220;lili&#8221;] ,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u5217\u8868Array,<\/p>\n<p>&#8220;children&#8221;: {\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u952e\u503cMap,<\/p>\n<p>&#8220;xiao song&#8221;: 18 ,<\/p>\n<p>&#8220;xiaoxiao song&#8221;: 19<\/p>\n<p>}<\/p>\n<p>&#8220;address&#8221;: {\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u7ed3\u6784Struct,<\/p>\n<p>&#8220;street&#8221;: &#8220;hai dian qu&#8221; ,<\/p>\n<p>&#8220;city&#8221;: &#8220;beijing&#8221;<\/p>\n<p>}<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2\uff09\u57fa\u4e8e\u4e0a\u8ff0\u6570\u636e\u7ed3\u6784\uff0c\u6211\u4eec\u5728Hive\u91cc\u521b\u5efa\u5bf9\u5e94\u7684\u8868\uff0c\u5e76\u5bfc\u5165\u6570\u636e\u3002<\/p>\n<p>\u521b\u5efa\u672c\u5730\u6d4b\u8bd5\u6587\u4ef6test.txt<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"548\">songsong,bingbing_lili,xiao song:18_xiaoxiao song:19,hai dian qu_beijing<\/p>\n<p>yangyang,caicai_susu,xiao yang:18_xiaoxiao yang:19,chao yang_beijing<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f\uff0cMAP\uff0cSTRUCT\u548cARRAY\u91cc\u7684\u5143\u7d20\u95f4\u5173\u7cfb\u90fd\u53ef\u4ee5\u7528\u540c\u4e00\u4e2a\u5b57\u7b26\u8868\u793a\uff0c\u8fd9\u91cc\u7528\u201c_\u201d\u3002<\/p>\n<p>3\uff09Hive\u4e0a\u521b\u5efa\u6d4b\u8bd5\u8868test<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"548\">create table test(<\/p>\n<p>name string,<\/p>\n<p>friends array&lt;string&gt;,<\/p>\n<p>children map&lt;string, int&gt;,<\/p>\n<p>address struct&lt;street:string, city:string&gt;<\/p>\n<p>)<\/p>\n<p>row format delimited fields terminated by &#8216;,&#8217;<\/p>\n<p>collection items terminated by &#8216;_&#8217;<\/p>\n<p>map keys terminated by &#8216;:&#8217;<\/p>\n<p>lines terminated by &#8216;\\n&#8217;;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b57\u6bb5\u89e3\u91ca\uff1a<\/p>\n<p>row format delimited fields terminated by &#8216;,&#8217;\u00a0 &#8212; \u5217\u5206\u9694\u7b26<\/p>\n<p>collection items terminated by &#8216;_&#8217;\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211;MAP STRUCT \u548c ARRAY \u7684\u5206\u9694\u7b26(\u6570\u636e\u5206\u5272\u7b26\u53f7)<\/p>\n<p>map keys terminated by &#8216;:&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8212; MAP\u4e2d\u7684key\u4e0evalue\u7684\u5206\u9694\u7b26<\/p>\n<p>lines terminated by &#8216;\\n&#8217;;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8212; \u884c\u5206\u9694\u7b26<\/p>\n<p>4\uff09\u5bfc\u5165\u6587\u672c\u6570\u636e\u5230\u6d4b\u8bd5\u8868<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"548\">hive (default)&gt; load data <span style=\"color: #ff0000;\">local<\/span> inpath &#8216;\/opt\/module\/datas\/test.txt&#8217; into table test;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>5\uff09\u8bbf\u95ee\u4e09\u79cd\u96c6\u5408\u5217\u91cc\u7684\u6570\u636e\uff0c\u4ee5\u4e0b\u5206\u522b\u662fARRAY\uff0cMAP\uff0cSTRUCT\u7684\u8bbf\u95ee\u65b9\u5f0f<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"548\">hive (default)&gt; select <span style=\"color: #ff0000;\">friends[1],children[&#8216;xiao song&#8217;]<\/span>,address.city from test where<span style=\"color: #ff0000;\"> name=&#8221;songsong&#8221;;<\/span><\/p>\n<p>OK<\/p>\n<p>_c0\u00a0\u00a0\u00a0\u00a0 _c1\u00a0\u00a0\u00a0\u00a0 city<\/p>\n<p>lili\u00a0\u00a0 \u00a018\u00a0\u00a0\u00a0\u00a0\u00a0 beijing<\/p>\n<p>Time taken: 0.076 seconds, Fetched: 1 row(s)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5982\u679c\u8d77\u522b\u540d\uff1aselect friends[1] <span style=\"color: #ff0000;\">as pengyou<\/span> from test where name=&#8221;songsong&#8221;;<\/p>\n<h2>3.3 \u7c7b\u578b\u8f6c\u5316<\/h2>\n<p><span style=\"color: #0000ff;\">Hive\u7684\u539f\u5b50\u6570\u636e\u7c7b\u578b\u662f\u53ef\u4ee5\u8fdb\u884c\u9690\u5f0f\u8f6c\u6362\u7684\uff0c\u7c7b\u4f3c\u4e8eJava\u7684\u7c7b\u578b\u8f6c\u6362\uff0c\u4f8b\u5982\u67d0\u8868\u8fbe\u5f0f\u4f7f\u7528INT\u7c7b\u578b\uff0cTINYINT\u4f1a\u81ea\u52a8\u8f6c\u6362\u4e3aINT\u7c7b\u578b\uff0c\u4f46\u662fHive\u4e0d\u4f1a\u8fdb\u884c\u53cd\u5411\u8f6c\u5316\uff0c\u4f8b\u5982\uff0c\u67d0\u8868\u8fbe\u5f0f\u4f7f\u7528TINYINT\u7c7b\u578b\uff0cINT\u4e0d\u4f1a\u81ea\u52a8\u8f6c\u6362\u4e3aTINYINT\u7c7b\u578b\uff0c\u5b83\u4f1a\u8fd4\u56de\u9519\u8bef\uff0c\u9664\u975e\u4f7f\u7528CAST\u64cd\u4f5c\u3002<\/span><\/p>\n<p>1\uff09\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\u89c4\u5219\u5982\u4e0b\u3002<\/p>\n<p>\uff081\uff09\u4efb\u4f55\u6574\u6570\u7c7b\u578b\u90fd\u53ef\u4ee5\u9690\u5f0f\u5730\u8f6c\u6362\u4e3a\u4e00\u4e2a\u8303\u56f4\u66f4\u5e7f\u7684\u7c7b\u578b\uff0c\u5982TINYINT\u53ef\u4ee5\u8f6c\u6362\u6210INT\uff0cINT\u53ef\u4ee5\u8f6c\u6362\u6210BIGINT\u3002<\/p>\n<p>\uff082\uff09\u6240\u6709\u6574\u6570\u7c7b\u578b\u3001FLOAT\u548cSTRING\u7c7b\u578b\u90fd\u53ef\u4ee5\u9690\u5f0f\u5730\u8f6c\u6362\u6210DOUBLE\u3002<\/p>\n<p>\uff083\uff09TINYINT\u3001SMALLINT\u3001INT\u90fd\u53ef\u4ee5\u8f6c\u6362\u4e3aFLOAT\u3002<\/p>\n<p>\uff084\uff09BOOLEAN\u7c7b\u578b\u4e0d\u53ef\u4ee5\u8f6c\u6362\u4e3a\u4efb\u4f55\u5176\u5b83\u7684\u7c7b\u578b\u3002<\/p>\n<p>2\uff09<span style=\"color: #0000ff;\">\u53ef\u4ee5\u4f7f\u7528CAST\u64cd\u4f5c\u663e\u793a\u8fdb\u884c\u6570\u636e\u7c7b\u578b\u8f6c\u6362\uff0c\u4f8b\u5982CAST(&#8216;1&#8242; AS INT)\u5c06\u628a\u5b57\u7b26\u4e32&#8217;1&#8217; \u8f6c\u6362\u6210\u6574\u65701\uff1b\u5982\u679c\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u5931\u8d25\uff0c\u5982\u6267\u884cCAST(&#8216;X&#8217; AS INT)\uff0c\u8868\u8fbe\u5f0f\u8fd4\u56de\u7a7a\u503c NULL\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>3.1 \u57fa\u672c\u6570\u636e\u7c7b\u578b Hive\u6570\u636e\u7c7b\u578b Java\u6570\u636e\u7c7b\u578b \u957f\u5ea6 \u4f8b\u5b50 TINYINT byte 1byte\u6709\u7b26 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1320","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/1320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1320"}],"version-history":[{"count":1,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/1320\/revisions"}],"predecessor-version":[{"id":1321,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/1320\/revisions\/1321"}],"wp:attachment":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}