Skip to main content
Question

How to compare attribute schema with a file containing column names?


I have multiple tables and need to check if their schemas conform to specs which are specified in text files containing field names separated by line breaks. How can I compare if the field names are mapped correctly?

2 replies

chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • June 9, 2022

Hi @bradosav​ ,

I'd suggest the SchemaScanner for this as you can use it to detect schema drift (last section in that article). In your case, since you have a text file that is line delimited, you can simply read in the text file and perform the join to detect any changes between what attributes the table has and what your expected schema is.

SchemaScannerA few things to keep in mind, you may want to use Group By fme_feature_type in the SchemaScanner to ensure you are getting a single feature per feature type (table). Also, make note of the Ignore Attributes Containing to get rid of the format/feature attributes that aren't relevant and whether you want empty attributes to be included or not (in this case you likely want to set it to Use Default Data Type depending on what your tables look like).

SSParamsIf you are using a version of FME that doesn't have the SchemaScanner, this webinar covers a few solutions that should work in it's place.


  • Author
  • June 10, 2022

Thanks a lot! I didn't need grouping, but keeping empty features, yes! Solved!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings