Skip to main content
Question

Issue with SchemaScanner Misinterpreting ID Field Data Type


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6

I have an ID field that is correctly read by FME as varchar(22) when writing using the Feature Writer.

However, before that, I use the SchemaScanner, and it incorrectly detects the data type as fme_real64. As a result, the original value is eventually written in scientific notation, like 2.2072213393213062e+21, instead of preserving the original string format.

Is there a way to ensure that SchemaScanner correctly detects the field as varchar(22) to prevent this issue? Any suggestions would be appreciated!


 

 

5 replies

nielsgerrits
VIP

I think adding a space to OBJ_ID as a suffix using an AttributeCreator before the SchemaScanner and remove this space afte the SchemaScanner using an AttributeTrimmer should work. It is hacky and a workaround, but I think it does what you need.


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • March 19, 2025
nielsgerrits wrote:

I think adding a space to OBJ_ID as a suffix using an AttributeCreator before the SchemaScanner and remove this space afte the SchemaScanner using an AttributeTrimmer should work. It is hacky and a workaround, but I think it does what you need.

A space did not work but adding # worked however fme_varchar(23) of course instead fme_varchar(22). Do you know why SchemaScanner messes up  like this? 


nielsgerrits
VIP

It tries to interpret the data type, but why this results in a scientific notation, I do not know. What data format are you writing to?

As to the char 22 vs char 23, you probably can solve this by inserting a dummy feature with a dummy 22 character string as id in the stream before the SchemaScanner and remove this feature after the SchemaScanner. This is probably more performance efficient as well.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • March 19, 2025

Can you not set the type explicitly in an AttributeManager prior to the schemascanner?

 

 


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • March 19, 2025

@ebygomm What do you mean explicitly? When I add AttributeManager, it immediately recognizes varchar(22) and SchemaScanner still think it is fme_real64 although I added AttribiteManager


Reply


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