Page 1 of 1

Warning message on "dfloat" when using a aggregato

Posted: Mon Apr 04, 2005 4:13 am
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.

Posted: Mon Apr 04, 2005 5:34 am
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

Posted: Mon Apr 04, 2005 5:48 am
by supernova2005
great! warnings disappeared. Thanks.

Posted: Tue Apr 04, 2006 5:49 pm
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

Posted: Tue Apr 04, 2006 11:18 pm
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).

Posted: Wed Jan 26, 2011 3:04 pm
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.

Posted: Wed Jan 26, 2011 4:01 pm
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,