span8
span4
span8
span4
I've just had a support request which reminded me of an issue I had a few months ago using a looping transformer to page through HTTP requests, where I was ending up with more data than expected.The cause was the reusing a list attribute and I'd like the communities opinion on whether this behavior is a bug or just something to be aware of.
You can see what is happening with a simple workspace like
when the _list attribute is reused in the second AttributeSplitter it is not getting cleared before hand so it is retaining the 4 and 5 from the first AttributeSplitter.
It's easy to correct once you know what is happening but it can cause some head scratching to debug, particularly in a looping transformer.Should anything that creates a list clear out any existing data first or are their situations were this behavior is wanted?
Hmmm, interesting thought.It depends whether you are used to thinking of Lists as like an array, or just a special type of attribute that otherwise behaves like a conventional FME Feature Attribute.I similarly found I had to adjust my thinking of Lists being arrays, to instead just being a collection of Attributes that additionally happen to have an Index property.
Outside FME, we are used to operations that create an "array" will typically destroy the original array object, however the data concepts in FME are a bit different.For instance, in FME, renaming an Attribute to the name of an existing Attribute doesn't destroy all the original Attributes necessarily since an Attribute exists as an object that is local to the each individual feature vs a Table Field that is a global object to an entire table and all contained records (at least for conventional database formats that use this concept)
Setting Transformers to output to Attributes with a name that has already previously been used acts more like an Update operation: For any given Feature, if the "Updating" Transformer doesn't output an Attribute value, despite the user setting the output Attribute Name to be the same as one that already exists, there is nothing to do any update/replacement operation with.The Target Attribute of that Feature will not get a "Missing" value (ie.Won't be destroyed), it will simply retain its original value and remain intact.
Similarly with Lists, it could be argued that the second AttributeSplitter isn't actually deleting and replacing a List "object" from scratch, and is displaying behaviour consistent with how almost all other Transfomers that output Feature-by-Feature Attribute values work.它是什么,而不是做的是更新任何属性列表名称相同的,但只有当它输出相同名称的列表属性。如果AttributeSplitter_2用的名称输出属性“_list {4}”,那么它会更新一个名为“_list {4}”任何现有的属性,但如果它不输出的“_list {4}”的属性则没有属性更新将发生,并且该名称的任何现有的属性将不受影响。
如果你使用AttributeCreator或AttributeManager计算值,但选择输出到具有相同名称作为一个已经存在的属性时的属性相同的行为发生。如果他们评估为“失踪”对于任何特定的功能,那么原来的属性值(如果存在的话)将保持未被更新。即。它不会被删除。
这只是我们都习惯思维认为数据是“结构化”,由“表”,“场”和“阵列”的,我们那种期待FME操作操作就像我们看惯了,但是这不是 how FME treats data at all and is instead dealing with it in an unstructured way.
当然解决方法,其一是:
Explode lists with a minimum of transformers2 Answers
Create a list of filenames based on an attribute value, then assign list to new field1 Answer
Filter out or delete list values2 Answers
Failed to create unique list Python2 Answers
How to rename List Attribute to a List Attribute Component1 Answer
© 2020 Safe Software Inc |Legal