0

If 'Each' read GBK String from file and Write GBK String to file, how can i do? How to define it?

Fields namesFields = new Fields("zid", "vid", "title", "number");
sourcePipe = new Each(sourcePipe, new Fields("line"), new Parse(namesFields), Fields.ALL);
cdhit
  • 1,384
  • 1
  • 15
  • 38

2 Answers2

0

On Feb 27, 2013, at 11:24pm, chen dong wrote:

If i want to read String (format: GBK) and Write String(format: GBK). How can i do?

http://docs.cascading.org/cascading/2.1/javadoc/cascading/scheme/hadoop/TextLine.html

Use the constructor with charsetName parameter.

cdhit
  • 1,384
  • 1
  • 15
  • 38
0

Each is used to perform a function or filter on input data.

if you have data in columns like "zid", "vid", "title", "number",

you can perform filter on one of those columns .like you can filter data if column title is not having jdk string.

so that tuple with jdk string will be printed as output .

for that you have to write a user defined filter by implementing filter interface and extending baseoperation class.

Balaswamy Vaddeman
  • 8,360
  • 3
  • 30
  • 40