Reply
New Contributor
Posts: 1
Registered: ‎06-05-2017

count(*) get 0 row from hive orc table

Hi all I load a textfile fields split by '|' lines terminated by '\n' into a hive table and get the expected 134037 rows,Then I insert these data into a orc format hive table ,after successully executed this insert query i get 0 rows through select count(*) ,but from analyze the orc table it shows [ numFiles=1, numRows=134037, totalSize=2997023, rawDataSize=109240155 ],select * from this orc table also get nothing,does anyone know how does this happen?
Cloudera Employee
Posts: 276
Registered: ‎03-23-2015

Re: count(*) get 0 row from hive orc table

Hi,

Can you let us know:

- the DDL of both tables
- does it happen to any ORC table? Or just this one?
- what version of Hive or CDH are you using?

Thanks
New Contributor
Posts: 1
Registered: ‎04-27-2018

Re: count(*) get 0 row from hive orc table

[ Edited ]

did you find any reason/solution? I have a similar situation right now. 

 

I have created a text table and orc table. where text table have data and when I do insert overwrite from text table the query runs fine and when I do a count on orc table its zero.

 

hive> insert into table orc select * from text;

Query ID = hadoop_20180427190946_03edcce9-7a48-4876-aadb-6a7a1a862e50

Total jobs = 1

Launching Job 1 out of 1

Tez session was closed. Reopening...

Session re-established.

Status: Running (Executing on YARN cluster with App id application_1524689752360_0058)

 

----------------------------------------------------------------------------------------------

        VERTICES      MODE        STATUS  TOTAL  COMPLETED  RUNNING  PENDING  FAILED  KILLED  

----------------------------------------------------------------------------------------------

Map 1 .......... container     SUCCEEDED      7          7        0        0       0       0  

Reducer 2 ...... container     SUCCEEDED     10         10        0        0       0       0  

----------------------------------------------------------------------------------------------

VERTICES: 02/02  [==========================>>] 100%  ELAPSED TIME: 23.02 s    

----------------------------------------------------------------------------------------------

Loading data to table db.orc

OK

Time taken: 29.982 seconds

hive> select count(*) from orc;

Query ID = hadoop_20180427191026_faa4fa26-df05-4b52-aa31-f0c878b9c0bd

Total jobs = 1

Launching Job 1 out of 1

Status: Running (Executing on YARN cluster with App id application_1524689752360_0058)

 

----------------------------------------------------------------------------------------------

        VERTICES      MODE        STATUS  TOTAL  COMPLETED  RUNNING  PENDING  FAILED  KILLED  

----------------------------------------------------------------------------------------------

Map 1            container     SUCCEEDED      0          0        0        0       0       0  

Reducer 2 ...... container     SUCCEEDED      1          1        0        0       0       0  

----------------------------------------------------------------------------------------------

VERTICES: 01/02  [==========================>>] 100%  ELAPSED TIME: 3.49 s     

----------------------------------------------------------------------------------------------

OK

0

Time taken: 4.425 seconds, Fetched: 1 row(s)

hive> select count(*) from text;

Query ID = hadoop_20180427192401_fc0c4e26-0bb7-4d56-a7b9-17493cd5c88d

Total jobs = 1

Launching Job 1 out of 1

Tez session was closed. Reopening...

Session re-established.

Status: Running (Executing on YARN cluster with App id application_1524689752360_0059)

 

----------------------------------------------------------------------------------------------

        VERTICES      MODE        STATUS  TOTAL  COMPLETED  RUNNING  PENDING  FAILED  KILLED  

----------------------------------------------------------------------------------------------

Map 1 .......... container     SUCCEEDED      7          7        0        0       0       0  

Reducer 2 ...... container     SUCCEEDED      1          1        0        0       0       0  

----------------------------------------------------------------------------------------------

VERTICES: 02/02  [==========================>>] 100%  ELAPSED TIME: 10.19 s    

----------------------------------------------------------------------------------------------

OK

37504

Time taken: 15.506 seconds, Fetched: 1 row(s)

Announcements