Output for sort and dedup sort with null key

I have file containing 5 unique rows and I am passing them through SORT component using null key and and passing output of SORT to Dedup sort. What will happen, what will be the output.

Questions by abinitio17

Showing Answers 1 - 17 of 17 Answers

I think you need to you need to specify the option whether you need to keep the first or last or unique records , as far i know that there won't be any change in records , it will exact the same as the original file.This scenario i think you can use to delete any header or tailer records in a file.

geetha1223

  • Nov 4th, 2008
 

If there is no key used in the sort component, while using the dedup sort the output depends on the keep parameter.
If its set to firt then the output would have only the first record,
if its set to last the output would have the last record,
if its set to unique_only,then there would be no records in the output file.

  Was this answer useful?  Yes

Anshul Majawadia

  • May 2nd, 2013
 

dedup :
{} key - 1 record in sequence will go to out port (In case of keep first)
Null in key data - 1 st null will go to out port (In case of keep first)

  Was this answer useful?  Yes

ram

  • May 9th, 2013
 

Actually the thing is if u use sort component with {} key it will take alll values as key and pass the records as it is..and dedup will do pass the same if there is no duplicates

  Was this answer useful?  Yes

Ravindra Reddy

  • May 14th, 2013
 

Case:1 :If we can take null key in dedup sort also then output depend on keep parameter.
keep: first: 1st record
last: last record
unique: 0 records

Case 2: If we can take any key in dedup then output will be 5 records(if only ur i/p file contain unique rows only)

Keep: first : 5 records
last : 5 records
unique: 5 records

Mohanrajkumar B

  • Jun 26th, 2013
 

If you give a null key the Dedup will consider all the columns as key value !!

  Was this answer useful?  Yes

Moleng

  • Aug 27th, 2013
 

Assuming all other parameters are default, only the first record will be retain so if you have 5 unique records, the output result will be the first record. This is because the default keep parameter is first therefore it will retain only the first record.

  Was this answer useful?  Yes

vikrant

  • Jan 29th, 2014
 

As listed by other friends , here the considering tht the keep parameter has 3 values
1) keep : first - then it will allow the first record from the input port
2) keep : last then it will allow the last record from the input port
30 keep : unique , here it will compare each record with all the column subjected in the each record and will find out that the values of each and every column differ from the each and every column of the records in the input port.Thus to conclude all records then will be found as unique and hence all records will be found at the out port.

  Was this answer useful?  Yes

Minar

  • Jun 18th, 2014
 

keep first : one record(first record)
keep last : one record(last record)
keep unique : no records on output file this is best answer

  Was this answer useful?  Yes

eswer

  • Jul 9th, 2014
 

Hi dears,
Out of all answers Ravindra Reddy given perfect answer.If we take unique records and process key as null to sort then it will give 5 records,those records process through Dedup sort, output will be as below,
Keep:first--we have total unique records (no dups), so 5 records
Keep:last-- we have total unique records (no dups), so 5 records
Keep:unique--we have total unique records (no dups), so 5 records
If we have duplicate records, then the count will change other wise it will not.please correct me if i go wrong.

  Was this answer useful?  Yes

pavi

  • Sep 22nd, 2014
 

Will get error message if key is not specified in sort component.

  Was this answer useful?  Yes

milan

  • Jan 7th, 2015
 

you will not get error if you will not specify the key.

  Was this answer useful?  Yes

vira

  • Jan 26th, 2015
 

Null key in the sort component implicit all the fields are considered as keys for sorting.when the same is passed through dedup all the 5 records will gets resulted as they are unique records.

  Was this answer useful?  Yes

mohankrishna

  • Apr 8th, 2016
 

SORT wont do any sorting as key is blank, it just reads 5 records and writes them to output as it is. Now when this data is feed to dedup with blank key, it will output only one record as it treats the 5 record as a group due to blank key and give the first record to output

  Was this answer useful?  Yes

ahamed

  • May 12th, 2016
 

Output is one record

  Was this answer useful?  Yes

san

  • Aug 7th, 2018
 

1. In case of Null ket{} in sort component nothing will happen.
2. In case of Dedup sorted - keep - fist then you will get first record, Keep- Last then you will get last one, Keep- Unique only - in this case you will get 0 record in out port as it will consider all record as one group. so here system will not identify unique one.

  Was this answer useful?  Yes

Amaan Sajid Ansari

  • Nov 14th, 2018
 

In Case of sort output would be same as input (unsorted) in case of dedup will depend on no of partition and the dedup method used. Please refer to the other similar dedup question i have explain it in that

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions