My actual project is to read layers dynamically and set schema before writing it into target database. Just to understand how schema mapper works, I used schema mapper between layer and target database. I passed csv file with source field name and desired destination field name. When I ran the workspace the output has all the fields of the input. Please see the attachements for better understanding.
If you can attach a small example source dataset (zipped), your workspace as a template file (use Save As Template) then it will be easier for someone to try and identify why this isn't working for you. Some likely areas are;
- connect the output ports of the SchemaMapper to Inspector transformers. Are you getting mapped or unmapped features?
- SchemaMapper doesn't expose the target attributes in workbench. But they are on the features and if you use Data Inspector you will see them there if the schema mapping is working. Check the attribute _schemamapper_row_ids that SchemaMapper adds to the feature. This tells you what rows have been used in the schema mapping (if any).
- make sure your PostGIS writer has the attributes obj, ftype_code,state defined on the writer feature type. In your image of the workflow (workflow.png) it doesn't look like you have defined the new attributes on the target PostGIS writer feature type.
- on the SchemaMapper, maybe remove the Default Value Field entry (that sets the value of the target attribute) - refer to the SchemaMapper documentation
If you can attach a small example source dataset (zipped), your workspace as a template file (use Save As Template) then it will be easier for someone to try and identify why this isn't working for you. Some likely areas are;
- connect the output ports of the SchemaMapper to Inspector transformers. Are you getting mapped or unmapped features?
- SchemaMapper doesn't expose the target attributes in workbench. But they are on the features and if you use Data Inspector you will see them there if the schema mapping is working. Check the attribute _schemamapper_row_ids that SchemaMapper adds to the feature. This tells you what rows have been used in the schema mapping (if any).
- make sure your PostGIS writer has the attributes obj, ftype_code,state defined on the writer feature type. In your image of the workflow (workflow.png) it doesn't look like you have defined the new attributes on the target PostGIS writer feature type.
- on the SchemaMapper, maybe remove the Default Value Field entry (that sets the value of the target attribute) - refer to the SchemaMapper documentation
If you can attach a small example source dataset (zipped), your workspace as a template file (use Save As Template) then it will be easier for someone to try and identify why this isn't working for you. Some likely areas are;
- connect the output ports of the SchemaMapper to Inspector transformers. Are you getting mapped or unmapped features?
- SchemaMapper doesn't expose the target attributes in workbench. But they are on the features and if you use Data Inspector you will see them there if the schema mapping is working. Check the attribute _schemamapper_row_ids that SchemaMapper adds to the feature. This tells you what rows have been used in the schema mapping (if any).
- make sure your PostGIS writer has the attributes obj, ftype_code,state defined on the writer feature type. In your image of the workflow (workflow.png) it doesn't look like you have defined the new attributes on the target PostGIS writer feature type.
- on the SchemaMapper, maybe remove the Default Value Field entry (that sets the value of the target attribute) - refer to the SchemaMapper documentation
1. is the schemamapper renaming the attributes successfully. You need to set the attributes on the PostGIS writer to confirm that they are actually mapped (or view the data in Data Inspector)
2. how to configure the dynamic writer. I think is discussed in your other post