Hi- I have a lookup table I'd love to FeatureJoin in somehow, to rename the original columns to what's shown in my external lookup table. Unfortunately there is no predictable pattern to the renaming, so I can't realistically use BulkAttributeRenamer to do a pattern/rules-based renaming. . and at 118 columns, am hoping not to have to use AttributeManager or AttributeRenamer addressing each column manually. Any suggestions for using an external lookup table to do this? Thanks in advance!
Have a look at the SchemaMapper transformer.
That sounds like a case for the schema mapper. https://knowledge.safe.com/articles/1136/schemamapper-transformer-tutorial.html
Have a look at the SchemaMapper transformer.
See also this article: https://knowledge.safe.com/articles/1162/attribute-mapping-schemamapper.html
I believe that the SchemaMapper can be used even if the source/destination attribute names contain spaces. If it didn't work because of the spaces within attribute names, I would say it's a bug on the transformer.
I believe that the SchemaMapper can be used even if the source/destination attribute names contain spaces. If it didn't work because of the spaces within attribute names, I would say it's a bug on the transformer.
Ok thanks Takashi! Just for proof-of-concept I did some testing on very simple data. . and I still cannot get the SchemaMapper to rename the columns despite everything being setup just like what's shown in the https://knowledge.safe.com/articles/1162/attribute-mapping-schemamapper.html example. See screenshot below showing workspace, and the 'Create New Attribute' settings for SchemaMapper. It looks like SchemaMapper regonizes what I'd like to do, but 'NEWCOL1' and 'NEWCOL2' don't appear at my writer. I sure appreciate the help.
I believe that the SchemaMapper can be used even if the source/destination attribute names contain spaces. If it didn't work because of the spaces within attribute names, I would say it's a bug on the transformer.
The SchemaMapper won't expose the destination attribute names automatically. You will have to configure the User Attributes in the writer feature type with Manual mode.
The SchemaMapper won't expose the destination attribute names automatically. You will have to configure the User Attributes in the writer feature type with Manual mode.
Any guidance on what to do there would be appreciated, as it's not covered in the article. I hope that doesn't mean I have to enter the new renamed columns in manually. Thanks again.
If you create an external lookup table that contains not only source attribute and destination attribute columns but also feature type name and data type columns, the table can be used to configure both the SchemaMapper and dynamic writer feature type. If you do so, you don't need to expose destination attribute names any longer.
See here to learn how to configure dynamic writer feature type with a lookup table: Dynamic Workflows: Destination Schema is Derived from a Lookup Table
Any guidance on what to do there would be appreciated, as it's not covered in the article. I hope that doesn't mean I have to enter the new renamed columns in manually. Thanks again.
You could use a SchemaSetter to create a Schema Feature and use this with the data features to write your data dynamic.