udf类
package com.test.film;
import org.apache.hadoop.hive.ql.exec.UDF;
/*
* 功能:获取电影新闻
*/
public class GetFilmNews extends UDF {
public GetFilmNews() {
}
public String evaluate(String id, String name, String title, String author,
String publish_time_string, String release_date,
String release_status, String url, String summary, String body) {
StringBuilder line_result_sb = new StringBuilder();
// url
if(null == url || url.trim().equals("") || url.equals("-")){
return "";
}
// title
if(null == title || title.trim().equals("") || title.equals("-")){
return "";
}
title = title.trim();
title = title.replaceAll("·", "·");
title = title.replaceAll(""", "\"");
// summary
if(null == summary || summary.trim().equals("")){
summary = "&#