多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
* ANALYZE:分析表数据,用于执行计划选择的参考 * 收集表的统计信息,如行数、最大值等 * 使用时调用该信息加速查询 语法: ```sql ANALYZE TABLE employee COMPUTE STATISTICS; ANALYZE TABLE employee_partitioned PARTITION(year=2014, month=12) COMPUTE STATISTICS; ANALYZE TABLE employee_id COMPUTE STATISTICS FOR COLUMNS employee_id; ``` ```sql hive> analyze table login compute statistics; Query ID = root_20210514124040_1b1c5322-025c-4035-a47e-2a92f070a0df Total jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator Starting Job = job_1620851990518_0058, Tracking URL = http://hadoop101:8088/proxy/application_1620851990518_0058/ Kill Command = /opt/install/hadoop/bin/hadoop job -kill job_1620851990518_0058 Hadoop job information for Stage-0: number of mappers: 1; number of reducers: 0 2021-05-14 12:40:31,763 Stage-0 map = 0%, reduce = 0% 2021-05-14 12:40:38,043 Stage-0 map = 100%, reduce = 0%, Cumulative CPU 3.48 sec MapReduce Total cumulative CPU time: 3 seconds 480 msec Ended Job = job_1620851990518_0058 Table test_db.login stats: [numFiles=1, numRows=1410073, totalSize=43342833, rawDataSize=41932760] MapReduce Jobs Launched: Stage-Stage-0: Map: 1 Cumulative CPU: 3.48 sec HDFS Read: 43345490 HDFS Write: 80 SUCCESS Total MapReduce CPU Time Spent: 3 seconds 480 msec OK Time taken: 14.769 seconds ```