{"id":4992,"date":"2021-04-07T15:55:45","date_gmt":"2021-04-07T07:55:45","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=4992"},"modified":"2026-02-03T11:01:56","modified_gmt":"2026-02-03T03:01:56","slug":"inceptor%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8b%e8%a1%a8%e5%8d%a0%e7%94%a8%e7%a9%ba%e9%97%b4%e7%9a%84%e5%a4%a7%e5%b0%8f","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=4992","title":{"rendered":"quark\u5982\u4f55\u67e5\u770b\u8868\u5360\u7528\u7a7a\u95f4\u7684\u5927\u5c0f"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>\u7ecf\u5e38\u4f1a\u9047\u5230\u5ba2\u6237\u9700\u8981\u83b7\u53d6\u4e00\u5f20\u8868\u5360\u7528\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u6216\u8005\u9700\u8981\u6e05\u7406\u7a7a\u95f4\u3001\u6392\u67e5\u54ea\u4e9b\u8868\u5360\u7528\u7a7a\u95f4\u8fc7\u5927\u7684\u8bc9\u6c42\uff0c\u672c\u6587\u7ed3\u5408\u4e0d\u540c\u7684\u8868\u7c7b\u578b\u63d0\u4f9b\u67e5\u770b\u65b9\u6cd5\u3002<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<h4>1. orc\u8868\u3001text\u8868\u3001csv\u8868<\/h4>\n<p>\u53ef\u4ee5\u7528\u5230inceptor\u4e2d\u7684\u6570\u636e\u5b57\u5178\u8868<code>system.table_stats_v<\/code>\uff0c\u8be5\u89c6\u56fe\u662f\u901a\u8fc7<code>table_size<\/code>\u51fd\u6570\u5bf9<code>system.tables_v<\/code>\u89c6\u56fe\u7684<code>database_name<\/code>,<code>table_name<\/code>,<code>table_location<\/code>,<code>input_format<\/code>\u5217\u6765\u8ba1\u7b97\u8868\u7684\u5927\u5c0f\u7684\u3002\u7b80\u5355\u8bf4\u5c31\u662f\u6839\u636e\u8868\u7684location\uff0c\u53bb\u8c03\u7528\u5b58\u50a8\u7684\u63a5\u53e3\u83b7\u53d6\u5f97\u5230\u7684\u503c\u3002<\/p>\n<pre><code class=\"language-sql\">> DESCRIBE FUNCTION EXTENDED table_size;\n - table_size(database_name, table_name, table_location, input_format) \n - returns the size of database.table, eg: '101.9 M'\n> SELECT\n>   table_size('default',\n>              'people_orc',\n>              'hdfs:\/\/nameservice1\/inceptor1\/user\/hive\/warehouse\/default.db\/lkw\/people_orc',\n>              'orc')\n> FROM system.dual;\n - 414 M<\/code><\/pre>\n<blockquote>\n<p>\u6ce8\u610f\uff0c\u50cfES\u3001hyperdrive\u3001hyperbase\u8fd9\u4e9b\u5916\u90e8\u5b58\u50a8\u7684\u8868\u662f\u4e0d\u652f\u6301\u67e5\u770btable_size\u7684\uff0c\u6240\u4ee5\u8fd9\u4e9btable_format\u7c7b\u578b\u7684\u8868\uff0c\u5728\u8be5\u89c6\u56fe\u4e2d\u7684table_size\u4e3aNULL\uff0c\u672c\u6587\u4f1a\u901a\u8fc7\u5176\u4ed6\u65b9\u5f0f\u6765\u83b7\u53d6\u8fd9\u4e9b\u8868\u7684\u7a7a\u95f4\u5927\u5c0f\u3002<\/p>\n<\/blockquote>\n<pre><code class=\"language-sql\">--\u67e5\u770b\u6307\u5b9a\u8868\u5360\u7528\u7a7a\u95f4\u7684\u5927\u5c0f\n> SELECT * FROM system.table_stats_v t WHERE t.database_name='default' AND t.table_name='people_orc';<\/code><\/pre>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/01\/image-1609983751765.png\" style=\"display: block;\">\n<\/div>\n<pre><code class=\"language-sql\">--\u67e5\u770b\u6240\u6709orc\u8868\u3001text\u8868\u3001csv\u8868\u5360\u7528\u7a7a\u95f4\u7684\u5927\u5c0f\n\n-- \u8be5\u53c2\u6570\u907f\u514ddecimal\u7c7b\u578b\u5c0f\u6570\u70b9\u540e\u9762\u76840\u663e\u793a\u4e0d\u4e86\u9020\u6210\u7684\u6392\u5e8f\u6df7\u4e71\nSET inceptor.decimal.display.padding.zero=true;\n-- \u5bf9table_size\u5012\u5e8f\u6392\u5217\uff0c\u68c0\u67e5\u54ea\u4e9b\u8868\u5360\u7528\u7a7a\u95f4\u8fc7\u5927\uff0c\u6ce8\u610f\u907f\u5f00table_size\u4e3anull\u7684\u8868\nSELECT\n    t.database_name,\n    t.table_name,\n    t.table_format,\n    t.table_size,\n    decimal(CASE \n        WHEN t.table_size LIKE '%B' \n            THEN regex_substr(t.table_size,'[^ ]+',1)\/1024\/1024\/1024\n        WHEN t.table_size LIKE '%K' \n            THEN regex_substr(t.table_size,'[^ ]+',1)\/1024\/1024\n        WHEN t.table_size LIKE '%M' \n            THEN regex_substr(t.table_size,'[^ ]+',1)\/1024\n        WHEN t.table_size LIKE '%G' \n            THEN regex_substr(t.table_size,'[^ ]+',1)\/1\n        END\n        )||'G' AS size\nFROM system.table_stats_v t\n    WHERE t.table_size IS NOT NULL\n    ORDER BY size DESC ;<\/code><\/pre>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/01\/image-1609983659465.png\" style=\"display: block;\">\n<\/div>\n<h4>2. search\u8868<\/h4>\n<p><strong>\u65b9\u6cd5\u4e00\uff1ahead\u9875\u9762<\/strong><\/p>\n<p>\u901a\u8fc7search head \u7d22\u5f15\u9875\u9762\u4e0b\u7684size\u67e5\u770b\u5927\u5c0f<\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/01\/image-1609984591559.png\" style=\"display: block;\">\n<\/div>\n<p><strong>\u65b9\u6cd5\u4e8c\uff1acurl\u547d\u4ee4<\/strong><\/p>\n<p><code>curl -X GET &quot;172.22.23.1:9200\/_cat\/indices?pretty&quot;<\/code><\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/01\/image-1609984480977.png\" style=\"display: block;\">\n<\/div>\n<h4>3. hyperbase\u8868\u3001hyperdrive\u8868<\/h4>\n<p><strong>\u7edf\u8ba1hdfs\u4e2d{hbase.rootdir}\/datanase\/table_name\u7684\u5927\u5c0f<\/strong><\/p>\n<p><font color=red><em>\u6ce8\u610f! \u5e76\u4e0d\u662fshow create table {hbase_table} \u4e2dLOCATION\u7684\u8def\u5f84\u4e0b\u6587\u4ef6\u7684\u5927\u5c0f\u54e6 !<\/em><\/font><\/p>\n<pre><code class=\"language-shell\"># \u4e00\u822c\u5728TDH\u4e2dhbase.rootdir\u914d\u7f6e\u4e3ahdfs:\/\/nameservice1\/hyperbase1\n$ hadoop fs -du -s -h \/hyperbase1\/data\/datanase\/table_name<\/code><\/pre>\n<p>\u4ee5default\u5e93\u7684people_hyperbase_1000w\u8868\u4e3a\u4f8b<\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/01\/image-1609985166954.png\" style=\"display: block;\">\n<\/div>\n<h4>4. holodesk\u8868<\/h4>\n<p><strong>\u65b9\u6cd5\u4e00\uff1adbaservice_db_stats.holo_table_stats\u8868<\/strong><\/p>\n<p>\u8be5\u8868\u662fdbaservice9.2\u4ee5\u4e0a\u7248\u672c\u624d\u63d0\u4f9b\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u5e93\u8868\u7684\u5f62\u5f0f\u5b58\u50a8holodesk\u8868\u7684\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n<p><font color=red>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u4e2a\u8868\u7684\u6570\u636e\u5e76\u4e0d\u662f\u5b9e\u65f6\u51c6\u786e\u7684\uff0cDBAService\u4f1a\u5728\u6bcf\u592923:00\u66f4\u65b0\u6240\u6709\u5e93\u8868\u7684\u4fe1\u606f\uff0c\u5982\u679c\u60f3\u83b7\u53d6\u5b9e\u65f6\u6570\u636e\uff0c\u9700\u8981\u5728dbaservice\u8fdb\u884c\u4e00\u6b21Update data\u3002<\/font><\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/04\/image-1728467077218.png\" style=\"display: block;\">\n<\/div>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/04\/image-1713340587290.png\" style=\"display: block;\">\n<\/div>\n<p><strong>\u65b9\u6cd5\u4e8c\uff1aDBAservice\u9875\u9762<\/strong><\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/04\/image-1709541473256.png\" style=\"display: block;\">\n<\/div>\n<p>\u540c\u65f6\u6211\u4eec\u652f\u6301Download\u4e0b\u8f7d\u529f\u80fd\uff0c\u53ef\u4ee5\u5c06\u8868\u7684\u76f8\u5173\u4fe1\u606f\u6574\u5408\u5230\u4e00\u4e2aexcel\u6587\u4ef6\u79cd\uff0ce.g : <\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/04\/image-1709541534726.png\" style=\"display: block;\">\n<\/div>\n<p><strong>\u65b9\u6cd5\u4e09\uff1aRestful API<\/strong><\/p>\n<pre><code class=\"language-shell\">\u5982\u679c\u662fshiva1 (argodb3.x\uff0c\u7528namespace):\ncurl -u shiva:shiva -X GET \"172.22.23.95:4567\/table\/description?pretty&namespace=default&table_name=default.global_people_holodesk_2ba7ce71-fcad-4324-aa66-ad3692fad5c4\" | grep table_size_bytes\n\n\u5982\u679c\u662fshiva2 (argodb5.x\uff0c\u7528database):\ncurl -u shiva:shiva -X GET \"172.22.23.95:4567\/table\/description?pretty&database=default&table_name=default.global_people_holodesk_2ba7ce71-fcad-4324-aa66-ad3692fad5c4\" | grep table_size_bytes\n<\/code><\/pre>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/04\/image-1653449926308.png\" style=\"display: block;\">\n<\/div>\n<blockquote>\n<p>\u6ce8\uff1a\u8fd9\u91cc\u7684 750263814 \u5355\u4f4d\u4e3abytes<br \/>\ntable_size_bytes\uff0c\u8868\u6570\u636e\u66f4\u65b0\u4e4b\u540e\u4e00\u822c\u6709\u534a\u5c0f\u65f6\u7684\u540c\u6b65\u5ef6\u8fdf<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 \u7ecf\u5e38\u4f1a\u9047\u5230\u5ba2\u6237\u9700\u8981\u83b7\u53d6\u4e00\u5f20\u8868\u5360\u7528\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u6216\u8005\u9700\u8981\u6e05\u7406\u7a7a\u95f4\u3001\u6392\u67e5\u54ea\u4e9b\u8868\u5360\u7528\u7a7a\u95f4\u8fc7\u5927\u7684\u8bc9\u6c42\uff0c\u672c\u6587\u7ed3\u5408 ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=4992\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4992","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/4992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4992"}],"version-history":[{"count":3,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/4992\/revisions"}],"predecessor-version":[{"id":17977,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/4992\/revisions\/17977"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}