Does the SORT order change due to Partitioning?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Does the SORT order change due to Partitioning?

Post by deepa_shenoy »

Hi,

I wanted to know if the SORT order changes due to partitioning?

For e.g. if I have an Oracle Stage which has a SQL with an 'ORDER BY' clause, and then I send it to a COPY stage which has 'SAME' as its input partitioning, will the sorted data be maintained?

Also, is it a pre-requisite to sort data before a Change data capture stage?

Thanks in advance.

Deepa
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Oracle stage runs sequentially( if the table is not partitioned) and if you use SAME partition then you will have only one partition

In general if you use SAME partition then sort order is maintained.

Also, is it a pre-requisite to sort data before a Change data capture stage? Yes
You are the creator of your destiny - Swami Vivekananda
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Repartitioning will destroy sorted order. "Same" will preserve any sorted order.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

Can I SORT within the Change Data Capture stage itself?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No, but it appears that you can. What you're actually doing, on the Input tab, Partitioning, is setting up sorting on the input link to the stage, rather than within the stage itself. This will become a separate tsort operator in the compiled job. Don't forget to partition and sort both inputs identically.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

Hi,

I am getting this error while using the Change data capture Stage

CHCP_SRC_TRGT: When checking operator: Defaulting "SYS_CD" in transfer from "beforeRec" to "outputRec". [api/transfer_rep.C:1832]

SYS_CD is present in both the input links, and neither used as Change Key or Change Value.

What could be the issue?

Thanks in advance.

Deepa
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The issue is nothing to do with SORT order, so please begin a new thread. This will aid future searchers. Indeed, you might essay a Search yourself, since this question has been answered on DSXchange in the past.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply