Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get maximum size used by a string in Hive?

Tags:

sql

hadoop

hive

I want to know the maximum length a particular string column is taking. I tried taking the approach mentioned here: how to get the max size used by a field in table, but that did not work in Hive.

like image 986
VoodooChild Avatar asked Oct 15 '25 08:10

VoodooChild


1 Answers

In that example they use len, use length instead:

select max(length(mycolumn)) from mytable;

This works fine in hive QL.

like image 102
Roberto Congiu Avatar answered Oct 16 '25 21:10

Roberto Congiu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!