POSTGRES Writer: Fanout for feature type 'SQLCreator' failed to find feature type template 'schema_from_query'
POSTGRES writer: An error has occurred. Check the logfile above for details
I tried to create a workspace using a dynamic writer (see attachment) but I get the error above. The writer uses following parameters:
- Table Name: `@Value(fme_feature_type)`
The `fme_feature_type` attribute contains the value `SQLCreator` on my features because I use an SQLCreator to read the features.
- Schema Sources: `Schema From Schema Feature`
I’m using the schema feature from the SQLCreator.
- Schema Definition Name: `schema_from_query`
I think the schema definition name refers to the attribute called `fme_feature_type_name` on the schema feature. This attribute contains the value `schema_from_query` when using the schema feature from the SQLCreator. I have also tried to leave the Schema Definition Name field empty in the settings of the dynamic writer’s feature type. In this case it defaults to `Default from table name above`. But I get the same error message except that it says “failed to find feature type template 'SQLCreator'” instead of “failed to find feature type template 'schema_from_query'”.
I think the documentation for the Schema Definition Name option (see About Dynamic Workspaces) is really poor:
Schema Definition Name: Defines how elements in the schema definition of the feature type are named. By default, schema elements are named based on the feature type name, under General Parameters. Alternatively, you can name schema elements based on a specified attribute.
Defines how elements in the schema definition of the feature type are name?
What elements does this refer to??? I think this is worded very poorly.
I assume it refers to the `fme_feature_type_name` attribute on a schema feature. I guess the Schema Definition Name option is useful if you want to write multiple tables using a single writer and you have multiple schema features because the tables have different schemas. Then your actual data features need an attribute which tells FME which schema feature belong to which data features. This attribute should hold the same value as the `fme_feature_type_name` attribute on the corresponding schema feature.
Since my schema feature from the SQLCreator has a `fme_feature_type_name` of `schema_from_query`, I set `schema_from_query` as a constant value for the Schema Definition Name option.
But I still get the error message from above, which tells me that FME failed to find the feature type template ‘schema_from_query’. From my understanding, the log tells me that FME failed to find a schema feature with the `fme_feature_type_name` attribute containg the value `schema_from_query`.
I don’t understand why I get this error. Can someone explain why?
Offtopic: I have no idea what the correct category for this post is supposed to be. You can only choose between “Authoring”, “Data”, “Integration” and “Transformers”. I think Authoring and Data pretty much apply to any FME workspace.