[GitHub] xueyumusic commented on a change in pull request #6337: [FLINK-9853] [table] Add HEX support

2018-08-13 Thread GitBox
xueyumusic commented on a change in pull request #6337: [FLINK-9853] [table] 
Add HEX support 
URL: https://github.com/apache/flink/pull/6337#discussion_r209684500
 
 

 ##
 File path: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarFunctionsTest.scala
 ##
 @@ -392,6 +392,93 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
   "รครครค1234512345")
   }
 
+  @Test
+  def testHex(): Unit = {
+testAllApis(
+  100.hex(),
+  "100.hex()",
+  "HEX(100)",
+  "64")
+
+testAllApis(
+  'f2.hex(),
+  "f2.hex()",
+  "HEX(f2)",
+  "2a")
 
 Review comment:
   Yes, we should do it as well. Thanks @twalthr , I updated the code


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xueyumusic commented on a change in pull request #6337: [FLINK-9853] [table] Add HEX support

2018-08-05 Thread GitBox
xueyumusic commented on a change in pull request #6337: [FLINK-9853] [table] 
Add HEX support 
URL: https://github.com/apache/flink/pull/6337#discussion_r207736696
 
 

 ##
 File path: docs/dev/table/sql.md
 ##
 @@ -1664,6 +1664,17 @@ BIN(numeric)
   
 
 
+
+  
+{% highlight text %}
+HEX(numeric)
+HEX(string)
+  {% endhighlight %}
+  
+  
+Returns a string representation of an integer numeric value or a 
string in hex format. Returns null if numeric is null. E.g. "20" leads to "14", 
"100" leads to "64", "hello,world" leads to "68656c6c6f2c776f726c64".
 
 Review comment:
   Thanks @walterddr , I clarify the doc adding explicit explain `for numeric` 
or `for string`


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:
us...@infra.apache.org


With regards,
Apache Git Services