gpt4 book ai didi

hadoop - Hive 支持无符号数字数据类型

转载 作者:可可西里 更新时间:2023-11-01 16:29:20 26 4
gpt4 key购买 nike

我正在尝试将通常为无符号整数和无符号 Bigint 的数据加载到配置单元表中。根据 Hive 文档,我看到它只支持有符号整数和有符号大整数

INT/INTEGER (4-byte signed integer, from -2,147,483,648 to 2,147,483,647) BIGINT (8-byte signed integer, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)

有没有办法将无符号数值(tinyint、smallint、int、bigint)存储到 Hive 表中?

最佳答案

长篇小说:摘自Hive documentation关于DECIMAL数据类型

The DECIMAL type in Hive is based on Java's BigDecimal which is used for representing immutable arbitrary precision decimal numbers ... limited to 38 digits ...

As of Hive 0.13 users can specify scale and precision when creating tables ...
  ¤ if scale is not specified, it defaults to 0 (no fractional digits)
  ¤ if no precision is specified, it defaults to 10.

Integral literals larger than BIGINT must be handled with DECIMAL(38,0). The Postfix BD is required ...

所以 DECIMAL 绝对是您要查找的数据类型。

关于hadoop - Hive 支持无符号数字数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42559578/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com