使用逗号分隔数据处理pig中的复杂数据类型的问题

时间:2016-08-19 10:07:33

标签: apache-pig

我有这样的数据:

var typeName = "System.ArgumentNullException";
NamedType exceptionType = _compilatorStartContext.Compilation.GetTypeByMetadataName(typeName);
// exceptionType = NamedType System.IO.IOException

var tryStatement = arg as TryStatementSyntax;
CatchDeclarationSyntax @catch = tryStatement.Catches.First();
var declaration = @catch.Declaration;
// declaration = CatchDeclarationSyntax CatchDeclaration (Exception)
// TODO: decide whether declaration can be instantiated from exceptionType

我写了以下猪查询:

$ cat samp.txt 
Ramesh,[city#Bangalore],123
Arun,[city#Anantapur],345
Pranith,[city#US],456

当我在猪中执行上面的代码时,我收到以下错误:

A = load 'samp.txt' using PigStorage(',')
as(name:chararray,addr:map[chararray,chararray],empno:int);       

任何人都可以帮我解决此错误吗?

1 个答案:

答案 0 :(得分:1)

A= load 'pdemo/samp' using PigStorage(',') as (name:chararray,add:map[],empno:int);

现在它会起作用..