[ 
https://issues.apache.org/jira/browse/HIVE-18265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16432391#comment-16432391
 ] 

Hive QA commented on HIVE-18265:
--------------------------------

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  
0s{color} | {color:blue} Findbugs executables are not available. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  8m 
34s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m 
14s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
50s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  1m  
3s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  1m 
37s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m 
16s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  1m 
16s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} checkstyle {color} | {color:red}  0m 
58s{color} | {color:red} ql: The patch generated 3 new + 894 unchanged - 0 
fixed = 897 total (was 894) {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m 
 0s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  1m  
5s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
15s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black} 17m 14s{color} | 
{color:black} {color} |
\\
\\
|| Subsystem || Report/Notes ||
| Optional Tests |  asflicense  javac  javadoc  findbugs  checkstyle  compile  |
| uname | Linux hiveptest-server-upstream 3.16.0-4-amd64 #1 SMP Debian 
3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux |
| Build tool | maven |
| Personality | 
/data/hiveptest/working/yetus_PreCommit-HIVE-Build-10119/dev-support/hive-personality.sh
 |
| git revision | master / 820db60 |
| Default Java | 1.8.0_111 |
| checkstyle | 
http://104.198.109.242/logs//PreCommit-HIVE-Build-10119/yetus/diff-checkstyle-ql.txt
 |
| modules | C: ql U: ql |
| Console output | 
http://104.198.109.242/logs//PreCommit-HIVE-Build-10119/yetus.txt |
| Powered by | Apache Yetus    http://yetus.apache.org |


This message was automatically generated.



> desc formatted/extended or show create table can not fully display the result 
> when field or table comment contains tab character
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-18265
>                 URL: https://issues.apache.org/jira/browse/HIVE-18265
>             Project: Hive
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 1.2.1, 3.0.0
>            Reporter: Hui Huang
>            Assignee: Hui Huang
>            Priority: Major
>             Fix For: 3.1.0
>
>         Attachments: HIVE-18265.1.patch, HIVE-18265.patch
>
>
> Here are some examples:
> create table test_comment (id1 string comment 'full_\tname1', id2 string 
> comment 'full_\tname2', id3 string comment 'full_\tname3') stored as textfile;
> When execute `show create table test_comment`, we can see the following 
> content in the console,
> {quote}
> createtab_stmt
> CREATE TABLE `test_comment`(
>   `id1` string COMMENT 'full_
>   `id2` string COMMENT 'full_
>   `id3` string COMMENT 'full_
> ROW FORMAT SERDE
>   'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
> STORED AS INPUTFORMAT
>   'org.apache.hadoop.mapred.TextInputFormat'
> OUTPUTFORMAT
>   'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
> LOCATION
>   'hdfs://xxx/user/huanghui/warehouse/huanghuitest.db/test_comment'
> TBLPROPERTIES (
>   'transient_lastDdlTime'='1513095570')
> {quote}
> And the output of `desc formatted table ` is a little similar,
> {quote}
> col_name      data_type       comment
> \# col_name                   data_type               comment
> id1                   string                  full_
> id2                   string                  full_
> id3                   string                  full_
> \# Detailed Table Information
> (ignore)...
> {quote}
> When execute `desc extended test_comment`, the problem is more obvious,
> {quote}
> col_name      data_type       comment
> id1                   string                  full_
> id2                   string                  full_
> id3                   string                  full_
> Detailed Table Information    Table(tableName:test_comment, 
> dbName:huanghuitest, owner:huanghui, createTime:1513095570, lastAccessTime:0, 
> retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:id1, type:string, 
> comment:full_    name1), FieldSchema(name:id2, type:string, comment:full_
> {quote}
> *the rest of the content is lost*.
> The content is not really lost, it's just can not display normal. Because 
> hive store the result in LazyStruct, and LazyStruct use '\t' as field 
> separator:
> {code:java}
> // LazyStruct.java#parse()
> // Go through all bytes in the byte[]
>     while (fieldByteEnd <= structByteEnd) {
>       if (fieldByteEnd == structByteEnd || bytes[fieldByteEnd] == separator) {
>         // Reached the end of a field?
>         if (lastColumnTakesRest && fieldId == fields.length - 1) {
>           fieldByteEnd = structByteEnd;
>         }
>         startPosition[fieldId] = fieldByteBegin;
>         fieldId++;
>         if (fieldId == fields.length || fieldByteEnd == structByteEnd) {
>           // All fields have been parsed, or bytes have been parsed.
>           // We need to set the startPosition of fields.length to ensure we
>           // can use the same formula to calculate the length of each field.
>           // For missing fields, their starting positions will all be the 
> same,
>           // which will make their lengths to be -1 and uncheckedGetField will
>           // return these fields as NULLs.
>           for (int i = fieldId; i <= fields.length; i++) {
>             startPosition[i] = fieldByteEnd + 1;
>           }
>           break;
>         }
>         fieldByteBegin = fieldByteEnd + 1;
>         fieldByteEnd++;
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to