hive,如何使用“扩展”和“格式化”当描述表时?

发布于 2025-01-12 23:22:03 字数 101 浏览 2 评论 0 原文

键入时,

describe extended table_name, 

输出会聚集起来。那么有没有办法优雅地展示这些信息呢?

When typing

describe extended table_name, 

the output is massed up. So is there a way to show these infomation elegently?

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

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

发布评论

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

评论(1

征﹌骨岁月お 2025-01-19 23:22:03

优雅地展示取决于您的要求。您的两个命令将显示相同的结果,但不同。
描述扩展 - 这将显示表列、数据类型和表的其他详细信息。其他详细信息将显示在单行中。
describe formatted - 这将显示表列、数据类型和表的其他详细信息。其他详细信息将显示为多行。

您还可以使用describe table来获取列名和数据类型。

编辑 :
格式化程序选项中的分区信息以分层方式显示在数据中。您可以查看随附的屏幕截图。在示例中,源系统使用了一个分区,因此您可以看到它与数据类型一起显示。
分区信息

在描述扩展选项中,相同的参数被放入单行中,以便您可以在那里看到它。

show elegantly is something depends on your requirement. Both of your commands will show same result but differently.
describe extended - This will show table columns, data types, and other details of the table. Other details will be displayed in single line.
describe formatted - This will show table columns, data types, and other details of the table. Other details will be displayed into multiple lines.

You can also use describe table to just get column names and data types.

EDIT :
The partition info in formatter option is displayed in the data in a hierarchical manner. You can look into the attached screenshot. In the example, source system is used a partition so you can see it is shown along with data type.
Partition info

In describe extended option, same parameters are put into single line so you can see it there.

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