hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hive QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-18143) LazySimpleSerDe.LazyMap doesn't handle the condition of when map key is another column value
Date Mon, 27 Nov 2017 09:46:00 GMT

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

Hive QA commented on HIVE-18143:
--------------------------------

| (/) *{color:green}+1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  1s{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}  6m 19s{color}
| {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 18s{color} |
{color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 13s{color}
| {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 14s{color} |
{color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  0m 19s{color}
| {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 16s{color} |
{color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  0m 16s{color} | {color:green}
the patch passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 13s{color}
| {color:green} the patch passed {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}  0m 15s{color} |
{color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 12s{color}
| {color:green} The patch does not generate ASF License warnings. {color} |
| {color:black}{color} | {color:black} {color} | {color:black}  8m 34s{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/dev-support/hive-personality.sh |
| git revision | master / d9924ab |
| Default Java | 1.8.0_111 |
| modules | C: serde U: serde |
| Console output | http://104.198.109.242/logs//PreCommit-HIVE-Build-8001/yetus.txt |
| Powered by | Apache Yetus    http://yetus.apache.org |


This message was automatically generated.



> LazySimpleSerDe.LazyMap doesn't handle the condition of when map key is another column
value
> --------------------------------------------------------------------------------------------
>
>                 Key: HIVE-18143
>                 URL: https://issues.apache.org/jira/browse/HIVE-18143
>             Project: Hive
>          Issue Type: Bug
>          Components: Serializers/Deserializers
>    Affects Versions: 0.14.0, 1.2.2, 2.3.0
>            Reporter: wei
>            Assignee: wei
>             Fix For: 2.3.0
>
>         Attachments: HIVE-18143.patch
>
>
> LazySimpleSerDe.LazyMap doesn't handle the condition of when map key is another column
value. 
> eg: 
>  CREATE TABLE `demo`(                                                               

>    `create_timestamp` bigint,                                 
>    `ctime` string,                                               
>    `event_data` map<string,string>
>  )                                          
>  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'
> add data
> INSERT INTO TABLE demo
> select
> 1511192567909,
> '1511192567909',
> map('1511192567909', '05020918127a82816437ba9edac17fca42601');
> Do query:
> SELECT
>   create_timestamp,
>   ctime,
>   event_data,
>   event_data[create_timestamp],
>   event_data[ctime]
> FROM demo;
> RES:
> | create_timestamp  |     ctime      |                         event_data           
             |                  _c3                   |  _c4  |
> +-------------------+----------------+------------------------------------------------------------+----------------------------------------+-------+--+
> | 1511192567909     | 1511192567909  | {"1511192567909":"05020918127a82816437ba9edac17fca42601"}
 | 05020918127a82816437ba9edac17fca42601  | NULL  |
> event_data[ctime]  get value NULL
> _______________________________________
> In LazyMap.getMapValueElement method.
> {code:java}
> // Some comments here
> public Object getMapValueElement(Object key) {
>     if (!parsed) {
>       parse();
>     }
>     // search for the key
>     for (int i = 0; i < mapSize; i++) {
>       LazyPrimitive<?, ?> lazyKeyI = uncheckedGetKey(i);
>       if (lazyKeyI == null) {
>         continue;
>       }
>       // getWritableObject() will convert LazyPrimitive to actual primitive
>       // writable objects.
>       Object keyI = lazyKeyI.getWritableObject();
>       if (keyI == null) {
>         continue;
>       }
>       if (keyI.equals(key)) {
>         // Got a match, return the value
>         return uncheckedGetValue(i);
>       }
>     }
>     return null;
>   }
> {code}
> When the key is a cloumn and don't need convert, the key will be a LazyPrimitive object.
> keyI = lazyKeyI.getWritableObject() is actual primitive writable objects.
> keyI.equals(key) will be false.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message