span8
span4
嗨fme'ers,
I found quite a few questions this week that I would like to highlight, but in the end I went with this one because it was something I was dealing with for the last couple of days. It's all about the FeatureJoiner transformer, and the oddities that make it a little different to other FME transformers.
Q)我想我有两个表合并使用有限元分析tureJoiner. When I ran the program, I found that about 100 records went into the rejected output field. When I investigated I found that the column I used from the left table to join has null values. Could anyone guide me on how could I make sure that all records from left table come to the output table?
一)排序这是不是太难 - 您只需要过滤这些记录来绕过变压器 - 但我认为它突出显示了Featurejoiner有点不同的原因,所以让我们看看那些差异......
The scenario is that we wish to join two sets of features together with a common attribute key. For the longest time we had a transformer called the FeatureMerger that used to do this. But the FeatureMerger started to be relatively slow, and so we created a new transformer called the FeatureJoiner to take its place.
Featurejoiner是FeatureMerger的剥离版本,专为速度和简单而设计。但有时您需要Featuremerger的复杂性,处理特定用例,这是其中一个场合。
So the issue is that the user's data has null key values. Here's an example of my own:
I'm joining attributes onto park features. The ParkName is the attribute key used to join, but some of the ParkName values are空值. There are 15 parks with a空值name and both Left and Right inputs for them get rejected.
FeatureMerger变形金刚直接处理此参数:
FeatureJoiner正在剥离,并且没有相同的功能。所以,有几种选择。首先是测试空值values and have those features bypass the FeatureJoiner. This is the answer suggested by@bwn
The other method would be to use a NullAttributeMapper to give the parks a dummy name:
现在他们从加入点出来了。
您现在可能想知道为什么这些功能是加入的,当他们有一个不应该与任何东西都不匹配的假人的名称。
That's because the FeatureJoiner has a mode parameter to control what counts as a join:
A左join means all左features emerge from the Joined port, regardless of whether they found a match or not. AnInnerjoin would be the way to have unmatched左features emerge from the UnjoinedLeft port:
这是FeatureJoiner在FeatureMerger上使用的优势。它让您更好地处理作为加入的重要信息。
But you might also be wondering how 80 input features can lead to 84 output features...
额外输出功能的原因是数据中的重复。简而言之,有两个名为Strathcona Park的功能,以及两个名为Harden Park的功能。
The FeatureJoiner creates a join for every match, and outputs a feature for every join. Hence there are 65 features with valid keys, but 69 joins (each Strathcona Park and Hadden Park has two matches, not one).
FeatureMerger使用名为Process Duplicate供应商的参数处理此方案:
通过转动它,我只会获得每个键的连接,无论匹配的键数量如何。
This is the issue I was dealing with recently. I wanted to know which users on this site had asked a question. So I fed the users and questions table into a FeatureJoiner:
Notice that I got 15,461 joins. It created me a feature for every match between Users and Questions. That's why I plugged in a DuplicateFilter transformer, to keep just a set of users who have asked questions, not all of the questions as well.
结果...... 4,971不同的帐户在这个网站上提出了问题,这就是我想知道的。
If I really did want a list of questions per user, I could have used an Aggregator instead to create a list attribute for each of those 4,971 users.
Why did I not use the FeatureMerger? Because I figure this will actually run quicker. The FeatureJoiner is so much faster that the overall processing time is reduced, even if I need to throw an extra transformer in there.
总之,Featuremerger更像是我们习惯的FME变形金刚;它有各种参数和选项来控制所有不同方案。
The FeatureJoiner is sparser in terms of parameters. You have fewer options to control it. However it runs so quickly that it's worth using. Plus, if you don't want the complexity, you don't get confused by irrelevant parameters.
You just have to be aware - as this question showed - that extra steps may be needed before and after.
就像我提到的那样,本周还有很多兴趣的问题......
© 2020 Safe Software Inc |Legal