Hello,
I think you might have loaded data by using an external tool into the table
location; you should run:
analyze table table1 compute statistics ;
or
analyze table table1 compute statistics for columns;
And/or disable hive.optimize.metadataonly - but having bad statistics is not
good at all...
I would also recommend to use an "external" table in case some other program
(beyond hive) is also writing to the table location.
cheers,
Zoltan
On 09/05/2018 11:46 AM, cang...@tsign.cn wrote:
hello,
1. i encounter a wired problem. “select count(*) from table1”return me "0",
but there are a lot of data in the 'table1'.
i check the metastore tables(mysql). the "table_params" show both "numFiles'='0" and 'numRows=0 for "table1" . but the "select count(*) from talbe1" is ok just a few
days ago.
but rigth now ,some table is ok ,some's bad. so i'm confuse about the behavior of "count(*)". (all of them have no partition used. and the hive vesion is 2.1.1000 in HDP.
and the hive.stats.autogather is true. and
Interactive Query is no
)
2. one more problem. does "ALTER TABLE table1 SET TBLPROPERTIES ('numRows'='0');" effect
the "select count(*) from table1"? i'm suppose this would break the data consistency
some pics for problem 1:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*芮波*
Rober
--------
phone: 13282023300
e-mail: cang...@tsign.cn <mailto:cang...@tsign.cn>