[ 
https://issues.apache.org/jira/browse/HIVE-14146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Vary updated HIVE-14146:
------------------------------
    Attachment: HIVE-14146.9.patch

The index comments with newlines are handled now

I had to change several test outputs to match the changes:
- describe_comment_indent.q.out - With multiline comments the extra lines was 
not indented appropriately. My patch solves this problem
- create_view_translate.q.out, create_view_partitioned.q.out, 
create_view.q.out, alter_view_as_select.q.out - Describing views a little nicer 
now - the multiline select is indented
- create_like.q.out - Table parameters containing newlines displayed nicely

The comments in describe database XXX results is not handled yet. The problem 
here is that the comment is the 2nd column, so printing the extra lines is not 
trivial. Either I would like to leave this as-is, or put this to another jira, 
or reorder the fields, so the comment is the last.

{noformat:title=Current}
hive> describe database escape_comments_db;
escape_comments_db      a\nb    file:/tmp/hive/warehouse/escape_comments_db.db  
petervary       USER
{noformat}

It is not too much hassle to do this:
{noformat:title=Proposed}
hive> describe database escape_comments_db;
escape_comments_db      file:/tmp/warehouse/escape_comments_db.db       
petervary       USER    a
                                                                                
                b
{noformat}

I am not convinced that it is worth to do this, or even if anyone would 
understand this:
{noformat:title=Alternative}
hive> describe database escape_comments_db;
escape_comments_db      a       file:/tmp/hive/warehouse/escape_comments_db.db  
petervary       USER
                        b
{noformat}

What do you think?

> Column comments with "\n" character "corrupts" table metadata
> -------------------------------------------------------------
>
>                 Key: HIVE-14146
>                 URL: https://issues.apache.org/jira/browse/HIVE-14146
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>    Affects Versions: 2.2.0
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>         Attachments: HIVE-14146.2.patch, HIVE-14146.3.patch, 
> HIVE-14146.4.patch, HIVE-14146.5.patch, HIVE-14146.6.patch, 
> HIVE-14146.7.patch, HIVE-14146.8.patch, HIVE-14146.9.patch, HIVE-14146.patch
>
>
> Create a table with the following(noting the \n in the COMMENT):
> {noformat}
> CREATE TABLE commtest(first_nm string COMMENT 'Indicates First name\nof an 
> individual’);
> {noformat}
> Describe shows that now the metadata is messed up:
> {noformat}
> beeline> describe commtest;
> +-------------------+------------+-----------------------+--+
> |     col_name      | data_type  |        comment        |
> +-------------------+------------+-----------------------+--+
> | first_nm             | string       | Indicates First name  |
> | of an individual  | NULL       | NULL                  |
> +-------------------+------------+-----------------------+--+
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to