Skip to main content
Solved

I have a dynamic workflow that takes files and loads them into postGIS using FeatureWriter. I am having issues with datasets that contain date fields with some null values resulting in features getting skipped.

  • November 23, 2022
  • 4 replies
  • 53 views

tomcolley
Contributor
Forum|alt.badge.img+4

The writer seems to be trying to write '00000000' for these features rather than leaving it as null

 

Is there a way to stop this behaviour? In a standard workbench I could set a default value but it feels like I shouldn't need to do that as postgres can handle null values in date fields and I don't know how I could change the values as it's a dynamic schema.

 

Errors in log:

Value of attribute 'createdate' could not be converted to type 'date'. Feature will be logged and skipped

 

Attribute(string: UTF-8)      : `CREATEDATE' has value `00000000'

 

---

Schema definition for field:

attribute{8}.fme_data_type fme_date

attribute{8}.name CREATEDATE

attribute{8}.native_data_type date

The next line is missing for features that do not have a value:

CREATEDATE 20031118

 

Best answer by ebygomm

Thanks for you're comment, you are indeed correct the values are 00000000 before they go into the writer, the issue seems to be with the Shapefile reader as the values are null in the dataset when viewed in QGIS but are being padded out when read in FME:

 

NEXTTEST (string: UTF-8) 00000000

Shapefiles don't officially support null values which is why you don't see them as nulls. See

 

https://community.safe.com/s/question/0D54Q00008OcM97SAF/interpretation-empty-attribute-shape

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • November 23, 2022

Are you sure that before the writer the value of CREATEDATE is null and not 00000000 ?

 

I have no issue writing nulls to a postgres date field


tomcolley
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • 11 replies
  • December 21, 2022

Thanks for you're comment, you are indeed correct the values are 00000000 before they go into the writer, the issue seems to be with the Shapefile reader as the values are null in the dataset when viewed in QGIS but are being padded out when read in FME:

 

NEXTTEST (string: UTF-8) 00000000


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • Best Answer
  • December 21, 2022

Thanks for you're comment, you are indeed correct the values are 00000000 before they go into the writer, the issue seems to be with the Shapefile reader as the values are null in the dataset when viewed in QGIS but are being padded out when read in FME:

 

NEXTTEST (string: UTF-8) 00000000

Shapefiles don't officially support null values which is why you don't see them as nulls. See

 

https://community.safe.com/s/question/0D54Q00008OcM97SAF/interpretation-empty-attribute-shape


tomcolley
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • 11 replies
  • December 21, 2022

Shapefiles don't officially support null values which is why you don't see them as nulls. See

 

https://community.safe.com/s/question/0D54Q00008OcM97SAF/interpretation-empty-attribute-shape

Thanks very much, that makes sense now.​