我有 50 个字段,在 pig 中是否有任何选项可以在 Apache Pig 中打印前 40 个字段?我需要类似范围 $0-$39 的东西 [英] 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

查看:25
本文介绍了我有 50 个字段,在 pig 中是否有任何选项可以在 Apache Pig 中打印前 40 个字段?我需要类似范围 $0-$39 的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 50 个字段,pig 中是否有任何选项可以打印前 40 个字段?我需要类似范围 $0-$39 的东西.我不想指定每个字段,如 $0、$1、$2 等

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?

推荐答案

您可以使用 .. 表示法.

You can use the .. notation.

前 40 个字段

B = FOREACH A GENERATE $0..$39;

所有字段

B = FOREACH A GENERATE $0..;

多个范围,例如第一个 10,15-20,25-50

Multiple ranges,for example first 10,15-20,25-50

B = FOREACH A GENERATE $0..$9,$14..$19,$24..;

随机字段 22,33-44,46

Random fields 22,33-44,46

B = FOREACH A GENERATE $21,$32..$43,$45;

这篇关于我有 50 个字段,在 pig 中是否有任何选项可以在 Apache Pig 中打印前 40 个字段?我需要类似范围 $0-$39 的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆