You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "dbgp2021 (Jira)" <ji...@apache.org> on 2021/03/27 09:04:00 UTC

[jira] [Updated] (HIVE-24903) Change String.getBytes() to DFSUtil.string2Bytes(String) to avoid Unsupported Encoding Exception

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

dbgp2021 updated HIVE-24903:
----------------------------
    Attachment: 1.patch

> Change String.getBytes() to DFSUtil.string2Bytes(String) to avoid Unsupported Encoding Exception
> ------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-24903
>                 URL: https://issues.apache.org/jira/browse/HIVE-24903
>             Project: Hive
>          Issue Type: Bug
>            Reporter: dbgp2021
>            Priority: Major
>         Attachments: 1.patch
>
>
> Hello,
> I found that DFSUtil.string2Bytes(String) can be used here instead of String.getBytes(). Otherwise, the API String.getBytes() may cause potential risk of UnsupportedEncodingException since the behavior of this method when the string cannot be encoded in the default charset is unspecified. One recommended API is DFSUtil.string2Bytes(String) which provides more control over the encoding process and can avoid this exception.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)