UA 문자열에서 장치를 추출해야하는 하이브 UDF가 있습니다. https://github.com/tobie/ua-parserLeaseExpiredException 하이브에 사용자 정의 UDF가있는 경우
UDF를 오히려 간단하다 : 그것은 UA-파서 라이브러리를 사용
public class DeviceTypeExtractTest extends UDF{
private Text result = new Text();
private static final Parser uaParser;
static {
try {
uaParser = new Parser();
}
catch(IOException e) {
throw new RuntimeException("Could not instantiate User-Agent parser.");
}
}
public Text evaluate(Text uaField){
if (uaField == null) {
return null;
}
try
{
String uaString = uaField.toString();
Client client = uaParser.parse(uaString);
result.set(client.device.family);
return result;
}
catch(Exception e)
{
return null;
}
}
}
을 그리고 작은 데이터 세트에서 실행할 때 잘 작동합니다. 만 10 행의 큰 데이터 세트에서이를 테스트 할 때
create table categories(
cat string);
insert overwrite table categories select DEVICE_TYPE_EXTRACT(user_agent) from raw_logs;
그러나, 나는 모든 시도에서이 LeaseExpiredException를 얻을 : http://pastebin.com/yK6Qmx6r
그리고 내지도 및 감소 프로세스 시간 동안 0 %에 붙어 남아 있습니다. 이 udf를 꺼내 테스트 용으로 내부 하이브 UDF를 사용하면이 동작이 일어나지 않습니다.
AMI 버전 2.4.5 (Hive 0.11.0.2 및 Hadoop 1.0.3)가 적용된 Amazon EMR 클러스터에서 실행 중입니다.
더 나은 하드웨어를 배치하여 클러스터의 성능을 향상 시키려고했지만 모든 하드웨어 시나리오에서 동일한 문제가 발생합니다.
아이디어가 있으십니까?