Skip to main content
Question

identifying fields with values that will be truncated

  • September 27, 2013
  • 4 replies
  • 63 views

Forum|alt.badge.img+1
Hi

 

 

I'm looking for a quick way (hopefully) to identify fields that will have their values truncated on writing to output. Using the StringLengthCalculator works great but only on a single field, so I would need to string lots of them together - as my data is being written to a database with multiple tables and multiple attributes per table, I'm trying to avoid this. I need something like the StatisticsCalculator which can generate summary stats for multiple fields at a time,.. but the problem being calculating the string length first as StatsCalc works on the values. And my output values will differ to input values.

 

I expect this is a comon problem - is there something I'm missing?

 

Any ideas & help much appreciated,

 

 

Thanks

 

Mary

4 replies

david_r
Celebrity
  • September 27, 2013
Hi,

 

 

this sounds like a case where a custom transformer could be in order. This way you could re-use the functionality several times over in your workspace(s).

 

 

The challenge is that the workspace transformers doesn't have any knowledge about the output format at run-time, meaning that your (custom) transformer won't know the field length limitations in your output feature.

 

 

You could define the maximal field lengths of the output feature types in an external document (e.g. csv or Excel) and then use the SchemaMapper from your custom transformer to compare and flag as appropriate.

 

 

David

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • September 27, 2013
Hi,

 

It is indeed a common problem and even the store transformer (StringLengthFormatter) only works with one attribute at a time.

 

 


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • September 27, 2013
Hi,

 

 

What I did in the past was to export the db schema, that way you know the destinations attributes lenghts and use that in the ws to compare to the input attributes.

tim_wood
Contributor
Forum|alt.badge.img+8
  • Contributor
  • June 17, 2019

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings