You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/09/07 13:50:02 UTC

[GitHub] xueyumusic commented on a change in pull request #6579: [FLINK-10174][table] fix getbytes in hex and toBase64

xueyumusic 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_r215964734
 
 

 ##########
 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:
   Thanks for the suggestion! @twalthr . It looks this place https://github.com/apache/flink/blob/master/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/calls/HashCalcCallGen.scala#L71
   also used Charsets.UTF_8, maybe could update at the same time.

----------------------------------------------------------------
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


With regards,
Apache Git Services