Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

hi i am planning to took HDPCD certificate exam this week. on practice exam in amazon webservices flight_delays1.csv file contains data with header. In exam i need to remove header manually ??

avatar
New Member
@rich

hi i am planning to took HDPCD certificate exam this week. on practice exam in amazon webservices flight_delays1.csv file contains data with header. In exam i need to remove header manually ??

1 ACCEPTED SOLUTION

avatar

@Ramesh Raja

In the exam you may or may not be required to remove the header.

It is better to know how to do it and feel more comfortable.

To remove header in Hive use tblproperties:

Create table test(
name string,
email string
)
tblproperties("skip.header.line.count"="1");

//Now load the data into the table

To remove header in Pig:

A=load 'data.csv' using PigStorage(',');
B=FILTER A BY $0>1;

View solution in original post

3 REPLIES 3

avatar

@Ramesh Raja

In the exam you may or may not be required to remove the header.

It is better to know how to do it and feel more comfortable.

To remove header in Hive use tblproperties:

Create table test(
name string,
email string
)
tblproperties("skip.header.line.count"="1");

//Now load the data into the table

To remove header in Pig:

A=load 'data.csv' using PigStorage(',');
B=FILTER A BY $0>1;

avatar
Super Collaborator

I did the same way, load data using PIG into a bag, and FILTER the TOP row.

Good Luck

avatar
@Ramesh Raja -

Pls consider accepting the answer if this has helped you at all.

Thank you.