VoodooChild VoodooChild - 2 years ago 103
SQL Question

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

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

Answer Source

In that example they use len, use length instead:

select max(length(mycolumn)) from mytable;

This works fine in hive QL.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download