package com.hadoopexpert;
import java.io.IOException;
import org.apache.pig.EvalFunc;
import org.apache.pig.data.Tuple;
public class upper extends EvalFunc<String>
{
public String exec(Tuple input) throws IOException {
if (input == null || input.size() == 0)
return null;
try{
String str = (String)input.get(0);
return str.toUpperCase(); }catch(Exception e){
throw new IOException("Caught exception processing input row ", e);
} }
}
以下の i/p ファイルの 2 列目を大文字に変換したいのですが、これは正しいコードですか? 入力ファイル - 101、ahmed 102、kranthi 103、sagar 104、mamtha