I have 50 fields, Is there any option in pig to print first 40 field in Apache Pig? I require something like range $0-$39
问题 I have 50 fields, Is there any option in pig to print first 40 fields? I require something like range $0-$39. I don’t want to specify each and every field like $0, $1,$2 etc Giving every column when the number of columns is less is acceptable but when there are a huge number of columns what is the case? 回答1: You can use the .. notation. First 40 fields B = FOREACH A GENERATE $0..$39; All fields B = FOREACH A GENERATE $0..; Multiple ranges,for example first 10,15-20,25-50 B = FOREACH A