[ 
https://issues.apache.org/jira/browse/HIVE-867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767819#action_12767819
 ] 

Edward Capriolo commented on HIVE-867:
--------------------------------------

@Zheng,

Thank you for your comments. I would like to do them the optimal way first 
pass. There is no rush here, and reopening jira issues and re-running tests 
takes more time then a few rounds of reviews.

Let's do it the most efficient way. If I understand you correctly should be....

{noformat}
 public Text evaluate(Text s, IntWritable r) {
+
+    if (s == null || r == null) {
+      return null;
+    }
+    
+    ////String data = s.toString();  //<-get rid of this
+    
+    if (r.get()>=data.length()){
+     //// result.set(s); //<--get rid of this
       arrayCopyHere(data, result);  //or 
      return s;
 
+    } else {
+     /// result.set( data.substring(0, r.get()) );   
          arrayCopyHere();
+    }
+    
+    return result;
+  }
+}

{noformat}

Is that right? just work with bytes array and the private member is the most 
efficient mechanism?

> Add add UDFs found in mysq
> --------------------------
>
>                 Key: HIVE-867
>                 URL: https://issues.apache.org/jira/browse/HIVE-867
>             Project: Hadoop Hive
>          Issue Type: New Feature
>            Reporter: Edward Capriolo
>            Assignee: Edward Capriolo
>         Attachments: hive-867-1.diff, hive-867-2.diff, hive-867-3.diff, 
> hive-867-7.diff
>
>
> Some UDF's that mysql has that hive does not. 
> atan
> aes_decrypt
> aes_encrypt
> bit_and
> bit_count
> bit_length
> bit_or
> bit_xor
> char_length
> char
> character_length
> collation
> compress
> crc32
> encode
> encrypt
> format
> greatest
> in
> inet_oton
> inet_ntoa
> match
> md5
> oct
> ord
> pi
> radians
> sha1 _sha
> sign
> sleep
> truncate

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to