<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                **為什么要查詢表數據量:** 在做數據倉庫管理時,數據導入hive或向表生成數據后形成的數據資產,表里的數據量和占用存儲空間是總要的元數據屬性。為方便數據使用時對數據有基本的了解,需要對表的數據量做統計。 <br/> 查詢表數據量的方式有如下幾種: **1. 使用 `analyze table` 主動生成元數據信息** ```sql 語法: analyze table tableName [partition(column[='value'])] compute statistics; 示例: hive> analyze table login compute statistics; [numFiles=1, 該表對應的文件數量 numRows=1410073, 表的總行數,等同于用select count(1) from login進行統計 totalSize=43342833, 數據需要的總存儲空間,單位為byte 如果采用壓縮格式存儲(如orc等),一般會小于rawDataSize rawDataSize=41932760 原始數據的總大小,單位為byte ] ``` **2. 使用`desc extended tableName`** ```sql hive> desc extended login; parameters:{totalSize=43342833, numRows=1410073, rawDataSize=41932760, numFiles=1, ``` **3. 使用 `show create table tableName` 查看** ```sql hive> desc extended login; TBLPROPERTIES ( 'COLUMN_STATS_ACCURATE'='true', 'numFiles'='1', 'numRows'='1410073', 'rawDataSize'='41932760', 'totalSize'='43342833', 'transient_lastDdlTime'='1622148758') ``` **4. `show tblproperties tableName(attrName)`可以查看單個屬性** ```sql hive> show tblproperties login("rawDataSize"); 41932760 hive> show tblproperties login("totalSize"); 43342833 hive> show tblproperties login("numRows"); 1410073 ``` **5. 使用 `explain select * from tableName`** ```sql hive> explain select * from login; OK STAGE DEPENDENCIES: Stage-0 is a root stage STAGE PLANS: Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: TableScan alias: login Statistics: Num rows: 1410073 Data size: 41932760 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: user_id (type: string), login_time (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 1410073 Data size: 41932760 Basic stats: COMPLETE Column stats: NONE ListSink ``` **6. 使用shell 命令查看表存儲文件大小** ```shell ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看