hive,如何使用“扩展”和“格式化”当描述表时?
键入时,
describe extended table_name,
输出会聚集起来。那么有没有办法优雅地展示这些信息呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
键入时,
describe extended table_name,
输出会聚集起来。那么有没有办法优雅地展示这些信息呢?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
优雅地展示取决于您的要求。您的两个命令将显示相同的结果,但不同。
描述扩展
- 这将显示表列、数据类型和表的其他详细信息。其他详细信息将显示在单行中。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.
In describe extended option, same parameters are put into single line so you can see it there.