Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "update" a column using pig latin

Imagine I have the following table available to me:

A: { x: int, y: int, z: int, ...99 other columns... }

I now want to transform this, such that z is set to NULL where x > y, with the resulting dataset to be stored as B.

and I want to do it without having to explicitly mention all the other columns, as this becomes a maintenance nightmare.

Is there a simple solution?

like image 775
Kevin Wright Avatar asked Nov 05 '22 04:11

Kevin Wright


1 Answers

This issue is tracked in this JIRA: PIG-1693 There needs to be a way in foreach to indicate "and all the rest of the fields"

Currently I don't know anything simpler than doing what you say or not loading Z and adding a new column Z with the star expression.

like image 192
Romain Avatar answered Nov 09 '22 12:11

Romain