hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yibing Shi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-15225) QueryPlan.getJSONValue should code against empty string values
Date Wed, 16 Nov 2016 23:07:59 GMT

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

Yibing Shi updated HIVE-15225:
------------------------------
    Status: Patch Available  (was: Open)

> QueryPlan.getJSONValue should code against empty string values
> --------------------------------------------------------------
>
>                 Key: HIVE-15225
>                 URL: https://issues.apache.org/jira/browse/HIVE-15225
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Yibing Shi
>         Attachments: HIVE-15225.1.patch
>
>
> The current {{QueryPlan.getJSONValue}} implementation is as below:
> {code}
>   public String getJSONValue(Object value) {
>     String v = "null";
>     if (value != null) {
>       v = value.toString();
>       if (v.charAt(0) != '[' && v.charAt(0) != '{') {
>         v = "\"" + v + "\"";
>       }
>     }
>     return v;
>   }
> {code}
> When {{value.toString()}} returns an empty string, a StringIndexOutOfRangeException would
be thrown out when "v.charAt(0)" is evaluated.



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

Mime
View raw message