with data as (
select array(named_struct('key','value', 'key2', 'тест')) as complex_object
)
select complex_object_str, length(complex_object_str) ascii_length, length(cast(complex_object_str as binary)) binary_length
from
(
select transform(complex_object) using '/bin/cat' as complex_object_str from data
)s;
1条答案
按热度按时间thigvfpy1#
我知道如何计算复杂对象的字符串表示的大小。也许这将帮助你得到一些想法,至少如何估计字节大小。
利用变换,我们可以得到字符串表示和检查长度。如果需要utf-8字符长度和utf-8八位字节数,hive2.3有字符长度和八位字节长度。
结果: