使用 Cassandra 在 Java 中嵌入 Pig:无法向后查看流中的多个标记
我正在本地模式下从 Java 运行一个 pig (0.9.1) 脚本,该脚本从 Cassandra (1.0.6) 获取记录。该脚本是:
rows = LOAD 'cassandra://Keyspace/Data' USING CassandraStorage() AS (key, columns: bag {T: tuple(name, value)});
cols = FOREACH rows GENERATE flatten(columns);
colnames = FOREACH cols GENERATE $0;
namegroups = GROUP colnames BY (chararray) $0;
namecounts = FOREACH namegroups GENERATE COUNT($1), group;
orderednames = ORDER namecounts BY $0;
topnames = LIMIT orderednames 50;
dump topnames;
每当我尝试运行该脚本时,我都会得到:
org.apache.pig.impl.logicalLayer.FrontendException: Error during parsing. can't look backwards more than one token in this stream
有趣的是,当我运行一个只读取和写入文件系统(没有 Cassandra)的 Pig 脚本时,它工作得很好。我正在使用 Cassandra 附带的 CassandraStorage 文件。
有什么想法吗?谢谢。
I am running a pig (0.9.1) script from Java in local mode that gets records from Cassandra (1.0.6). The script is:
rows = LOAD 'cassandra://Keyspace/Data' USING CassandraStorage() AS (key, columns: bag {T: tuple(name, value)});
cols = FOREACH rows GENERATE flatten(columns);
colnames = FOREACH cols GENERATE $0;
namegroups = GROUP colnames BY (chararray) $0;
namecounts = FOREACH namegroups GENERATE COUNT($1), group;
orderednames = ORDER namecounts BY $0;
topnames = LIMIT orderednames 50;
dump topnames;
Whenever I try to run the script, I get:
org.apache.pig.impl.logicalLayer.FrontendException: Error during parsing. can't look backwards more than one token in this stream
Interestingly, when I run a pig script that just reads and writes the filesystem (no Cassandra), it works fine. I am using the CassandraStorage file that comes with Cassandra.
Any ideas? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论