hive 是否支持结构体中的可选字段

发布于 2024-12-26 02:22:00 字数 339 浏览 3 评论 0原文

thrift 确实支持结构中的可选字段

struct Name {                                                                                                                                
  1: string firstname,
  2: optional string middlename,
  3: string lastname,
}

,但是 hive 支持创建具有类似结构类型的表吗? 我检查了 hive 的教程,发现没有办法设置“可选”关键字。

thrift does support optional fields in struct

struct Name {                                                                                                                                
  1: string firstname,
  2: optional string middlename,
  3: string lastname,
}

but does hive support to create a table with similar struct type, please?
I checked hive's tutorial and found no way to set 'optional' keyword.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

Hive 支持 NULL 值。您可以定义一个包含三个字段的表:

  • 名字
  • 中间名
  • 姓氏

中间名字段将包含 NULL,用于对应于一个人(我推测)没有中间名或中间名未知的情况的记录。

Hive supports NULL values. You can define a table with three fields:

  • firstname
  • middlename
  • lastname

The middlename field would contain NULLs for the records corresponding to the cases when a person (I presume) doesn't have a middle name or the middle name is not known.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文