我知道如何使用Hue在Hive中添加列注释。我特别希望在上显示注释,在Hue中的几行,当它太长而不能在一行上读取时。
我创建了一个表,我在以前的堆栈溢出帖子中找到了一个表作为示例:
代码语言:javascript运行复制 CREATE TABLE test_table(
col1 INT COMMENT 'col1 one line comment',
col2 STRING COMMENT 'col2 two lines comment',
col3 STRING COMMENT 'col3 three lines comment',
col4 STRING COMMENT 'col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines',
col5 STRING COMMENT 'col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis',
col6 STRING COMMENT 'This comment has a very long single word ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz123 which will not fit in a line by itself for small column widths.',
col7_NoComment STRING)
COMMENT 'table comment two lines';以下是“顺化”中表格的视图:
如您所见,注释没有中断。不管评论有多长,它仍然是在一行中添加的。
为了在Hue中将其拆分为多行,我考虑使用"\n“字符。以下是修改第6列的注释时关联的查询的结果:
代码语言:javascript运行复制ALTER TABLE test_table CHANGE COLUMN col6 col6 STRING COMMENT 'This comment has a very long single word ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz123 \n Line break here because it will not fit in a single line.'当试图编写多行注释时,在Hue中查看"table_test“的元数据:
如果您查看第6行,您可以看到Hue (或Hive)将应该是注释的内容解释为一个新列。所以现在不是有我的7列,我有8列。
您知道是否可以在Hue中显示列的多行注释吗?