Warning message on "dfloat" when using a aggregato

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
supernova2005
Participant
Posts: 37
Joined: Mon Jan 24, 2005 10:12 am

Warning message on "dfloat" when using a aggregato

Post by supernova2005 »

Hello everone,

I am using an aggregator to count the total number of rows on a input sequencial file. It is grouped by primary keys and the aggregation type is "Count Rows", however, I am getting a warning message.

ag_recordcount_audit_ag_recordcount_audit: When checking operator: When binding output interface field "RECORD_COUNT" to field "RECORD_COUNT": Implicit conversion; from source type "dfloat" to result type "int32": Possible range/precision limitation

Notice that I set the type of RECORD_COUNT as Integer.

any help will be greatly appreciated.

Thans.
yannish
Charter Member
Charter Member
Posts: 23
Joined: Mon Dec 29, 2003 7:38 am
Location: Finland, Northern Europe

Post by yannish »

What you have bumped into is the underlying heavily typed parallel engine. The aggregator operator is coded so that it will output its results as dfloat. Now that you have explicitly stated that you want it as integer the engine will do a default conversion from dfloat to integer. This kind of conversion can lead to lost precision i.e. when there are decimals as you probably figured out and this is what EE is trying to tell you. To get rid of the warning message change the output column to Double and the use e.g. Modify stage to change it to integer.

Cheers,

Janne
supernova2005
Participant
Posts: 37
Joined: Mon Jan 24, 2005 10:12 am

Post by supernova2005 »

great! warnings disappeared. Thanks.
gsherry1
Charter Member
Charter Member
Posts: 173
Joined: Fri Jun 17, 2005 8:31 am
Location: Canada

Post by gsherry1 »

Hello Forum,

The suggested solution above did not work for me.

I plugged a Modify stage between my aggregate stage and sequential file.

Sequential file has Integer (int32) column named count.
Aggregate is assigning a row count to a Double(dfloat) column named count_double.

My conversion specification:
count = count_double

My existing warning:
Sequential_File_40: When checking operator: When binding input interface field "count" to field "count": Implicit conversion from source type "dfloat" to result type "int32": Possible range/precision limitation.
At one point I was able to get the warning to be reported from the Modify Stage using some other specification, but at no point could I get the warning to dissapear.

Any suggestions?

Thanks,

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

Post by ray.wurlod »

The Aggregator stage uses dfloat internally. If you specify int32 as the output, you will get the warning, because not all dfloat numbers will fit into an int32.

It's annoying, but that's how it is.

Your choices are to specify dfloat as the data type of the column on the link between the Aggregator and Sequential File stages, or to create a message handler to demote the message to informational if you really do want to force the result to be int32 (remember that there is only one data type, "text", in a text file).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Post by Marley777 »

Thanks for reading.

Wanting to use the modify stage to convert dfloat to interger for fields comming out of the aggregator stage. I'm using DS 8.1 and the manual isn't specific enough for me, so wondering if someone could please pass along the sytax needed for converting dfloat to integer and small integer within a modify stage.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Well, let's see now.

From the manual (Parallel Job Developer's Guide): new_columnname [:new_type] = [explicit_conversion_function] old_columnname

For Integer: my_new_int:int32 = my_old_dfloat
For Smallint: my_new_smallint:int16 = my_old_dfloat

Per the manual, the dfloat to int conversions are default conversions, no specific function call is required. You still run the risk of overflow with these ints because the dfloat can have a larger value than Integer and SmallInt can hold.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply