You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/09/07 12:48:00 UTC

[jira] [Commented] (FLINK-10174) getbytes with no charsets test error for hex and toBase64

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

ASF GitHub Bot commented on FLINK-10174:
----------------------------------------

twalthr commented on a change in pull request #6579: [FLINK-10174][table] fix getbytes in hex and toBase64
URL: https://github.com/apache/flink/pull/6579#discussion_r215946888
 
 

 ##########
 File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/functions/ScalarFunctions.scala
 ##########
 @@ -221,7 +222,7 @@ object ScalarFunctions {
   /**
     * Returns the hex string of a string argument.
     */
-  def hex(x: String): String = Hex.encodeHexString(x.getBytes).toUpperCase()
+  def hex(x: String): String = Hex.encodeHexString(x.getBytes(Charsets.UTF_8)).toUpperCase()
 
 Review comment:
   @xueyumusic please enable more IDE checkstyles. `Charsets` is deprecated. I will fix this while merging.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> getbytes with no charsets test error for hex and toBase64
> ---------------------------------------------------------
>
>                 Key: FLINK-10174
>                 URL: https://issues.apache.org/jira/browse/FLINK-10174
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; SQL
>            Reporter: xueyu
>            Assignee: xueyu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>
> Hex and toBase64 builtin method use str.getBytes() with no Charset. It maybe depend on local execution environment for special Unicode and maybe result in errors when test Hex for special Unicode



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