How to do a row wise count in Hive

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How to do a row wise count in Hive



h1 h2 h3 h4 h5 h6 h7 h8



U U NULL U Y NULL Y X



U NULL U U Y Y X X



U U U NULL U NULL Y NULL



NULL NULL NULL NULL NULL NULL NULL NULL



X V U U Y NULL Z X



Y X NULL X Y Z U



X NULL U NULL NULL U Z Y



NULL NULL NULL NULL NULL NULL NULL NULL



Suppose, above data set is having 8 column h1,h2,h3......h8. if all the all the column is having NULL then the count is 0. if at least one column is having value then the count is 1.
like first row has a count of 6.(donot consider null values).



so, if a first row has 6 value then its count is 6 and next row has count of 7 and the last row has no value. so in this case the total count is 2 because only two row has information or values. because two row has values.



just tell me the code how do i count those eight column values row wise?? i am confused so just suggest me good solutions









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results