Skip to main content

Hey everyone,

 

I'm writing some data into a Snowflake database and getting a geometry validation error on the Snowflake side: SnowflakeSQLException: Geography validation failed.


When I run it thru the FME GeometryValidator - it passes.


If I run it thru the SQLExecutor and call ST_ISVALID it returns false so in theory, I could call the SQLExecutor for every record however with a million records, this really isn't feasible. 


I thought about grouping the inserts by 1000 and if it fails, run those 1000 thru the SQLExecutor however I couldn't figure out how to have the FeatureWriter continue if it fails on a group.


Does anyone have any ideas on how to get these records to continue. I really just want FME to remove any bad geometries and log which one's failed.

 

Thanks!

I’m not particularly familiar with snowflake, but I’ve come across similar issues in other systems.

The issue I’ve faced are when the precision of the geometry is greater than the destination system allows and it collapses vertices, or the entire geometry. For example

You have a line with two vertices:

  • 123.456789
  • 123.456777

FME looks at that and says that’s a line that is 0.000012 units long.

The source system however only has a precision of 4dp. Therefore it looks at the coordinates and sees:

  • 123.4567
  • 123.4567

Therefore it’s a line that is 0 units long, and therefore an invalid geometry