在 Pig 脚本中过滤列

Filter columns in Pig script

我正在从 CSV 中加载 Pig 中的数据。 加载数据后,我需要过滤掉列。

exportAllProductsCleaned = FOREACH exportAllProducts 
generate [=10=], , , , , , , , , , , , , , , , , , , , , , , , , , , , 

有没有办法让我只能指定

  1. 我需要删除的列 或者
  2. 我需要的列范围。 $1-15 然后 $18 - $30

可以吗?

是的,您可以使用“..”convention.Refer Support project range expression

exportAllProductsCleaned = FOREACH exportAllProducts GENERATE [=10=], , , , , , , , , , , , , , , , , , , , , , , , , , , , ;
exportAllProductsFiltered = FOREACH exportAllProductsCleaned GENERATE  .. , .. ;