0
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);
} }
}
Je veux convertir la deuxième colonne du fichier ci-dessous en majuscule est ce code correct? entrée Fichier- 101, 102 ahmed , kranthi 103, Sagar 104, mamthacomment puis-je écrire UDF pour convertir la deuxième colonne en majuscule