How can we ignore header line while loading data into Pig

0 votes

Suppose we have a dataset like below

"id","name","sal"

"1","jimmy","1000"

"2","hendrix","5000" 

How can we ignore header line while loading data into Pig?

Jul 22, 2019 in Big Data Hadoop by Varsha
692 views

1 answer to this question.

0 votes

You can use the following code:

A = load 'pigtest.txt' using PigStorage(',') as (id: chararray, name: chararray, sal: chararray);
ranked = rank A;
no_header = filter ranked by (rank_A > 1);
ordered = order no_header by rank_A;
new_A = foreach ordered generate id, name, sal;

Now, let's dump the new data,

dump new_A;

To know more, It's recommended to join Big Data Hadoop Course today.

answered Jul 22, 2019 by kiran

Related Questions In Big Data Hadoop

0 votes
1 answer

How can we send data from MongoDB to Hadoop?

The MongoDB Connector for Hadoop reads data ...READ MORE

answered Mar 27, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
2,097 views
+3 votes
1 answer

Getting Connection Error while loading data into table using cloudera hive

Hey Nafeesa, Itseems that Hive is not able ...READ MORE

answered Oct 4, 2018 in Big Data Hadoop by Vardhan
• 13,150 points
988 views
0 votes
1 answer

Hadoop Hive: How to skip the first line of csv while loading in hive table?

You can try this: CREATE TABLE temp ...READ MORE

answered Nov 8, 2018 in Big Data Hadoop by Omkar
• 69,220 points
8,936 views
0 votes
1 answer

Getting error while loading data into hive table

In the command you have used, the ...READ MORE

answered Jan 31, 2019 in Big Data Hadoop by Omkar
• 69,220 points
3,353 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,015 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,528 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,739 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,605 views
0 votes
1 answer

How can we ignore header line while loading data into Pig?

Suppose you need to load this in ...READ MORE

answered Jul 10, 2019 in Big Data Hadoop by Kiran
2,867 views
0 votes
1 answer

How to load data from HDFS into pig relation?

Hey, To load data from HDFS to pig ...READ MORE

answered May 7, 2019 in Big Data Hadoop by Gitika
• 65,770 points
3,246 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP