hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zheng Shao <zsh...@gmail.com>
Subject Re: built-in UTF8 checker
Date Wed, 21 Jul 2010 06:40:28 GMT
No, but it's very simple to write one.

public class MyUTF8StringChecker extends UDF {
  public boolean evaluate(Text t) {
    try {
      Text.validateUTF8(t.getBytes(), 0, t.getLength());
      return true;
     } catch (MalformedInputException e) {
       return false;
     }
  }
}


On Tue, Jul 20, 2010 at 12:03 PM, Ping Zhu <ping@sharethis.com> wrote:
> Hi,
>   Are there are any built-in functions in Hive to check whether a string is
> UTF8-encoding? I did some research about this issue but did not find useful
> resources. Thanks for your suggestions and help.
>   Ping



-- 
Yours,
Zheng
http://www.linkedin.com/in/zshao

Mime
View raw message