什么会导致模糊查找从引用表中返回一组 Null 值?

发布于 2024-08-23 00:01:03 字数 333 浏览 9 评论 0原文

我正在对表的视图进行模糊查找,该表可以很好地返回相似性,但偶尔会出现异常,但我似乎无法弄清楚是什么导致了问题。 有时,比较会从查找视图中得出空值,即使这些值同时存在于视图和原始表中,并且我为“精确”匹配选择的列在查找视图和原始表中都具有相同的值。源 SQL。

关于为什么它提取空值有什么想法吗?

替代文本 http://img689.imageshack.us/img689/4846/fuzzylkp.jpg< /a>

I'm doing a fuzzy lookup on a view of a table which does a fine job returning similarities with the occasional exception, and I can't seem to figure out what is causing the problem.
Every so often, the comparison will come up with null values from the lookup view, even though the values exist in both the view and the original table and the columns I have selected for "exact" match have identical values in both the lookup view and the source SQL.

Any thoughts as to why it's pulling null values?

alt text http://img689.imageshack.us/img689/4846/fuzzylkp.jpg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温折酒 2024-08-30 00:01:03

我发现通过更改列的顺序并将精确匹配项放在列表顶部,可以正确返回空结果。

I discovered that by changing the order of the columns, and placing the exact matches at the top of the list, the null results were returned properly.

煮酒 2024-08-30 00:01:03

在高级设置中更改 MinSimilarity 阈值 - 请参阅此文章,还有标题 运行时会发生什么

在确定最佳匹配时,最重要的参数是 MinSimilarity 阈值。您可以使用模糊查找 UI 设置此自定义属性。仅当参考元组的相似度大于或等于 MinSimilarity 阈值时,才会返回参考元组。通过设置高相似性要求,模糊查找将考虑更少的候选者,因此可能不会返回任何匹配项。如果您将 MinSimilarity 设置得较低,模糊查找将考虑更多候选者,并且可能更有可能找到匹配项,但搜索可能需要更长时间。

请注意,您可以为每个单独的列设置 MinSimilarity 以及记录级别和列级别。返回的任何匹配结果都必须满足在所有级别和所有列中设置的阈值。例如,您可以将记录级别 MinSimilarity 设置为 0.5,但要求 ZipCode 的 MinSimilarity 为 0.9,Name 的 MinSimilarity 为 0.4。模糊查找只会返回满足所有这些条件的结果。

简而言之,这意味着如果您将其设置得太高,您可能根本得不到任何匹配。我怀疑这就是导致 NULL 值的原因,因为即使将其设置为 1.0,也不可能仅在这种情况下所有值都为 NULL,我也对此表示怀疑,因为这不会是模糊的,而是精确匹配。

Change your MinSimilarity threshold in the advanced settings - See this article, and there the heading What Happens at Run Time:

In determining best matches, the most important parameter is the MinSimilarity threshold. You can set this custom property by using the Fuzzy Lookup UI. A reference tuple will be returned only if it has a Similarity that is greater than or equal to the MinSimilarity threshold. By setting a high similarity requirement, Fuzzy Lookup will consider fewer candidates and, as a result, may not return any matches. If you set MinSimilarity low, Fuzzy Lookup will consider more candidates and may be more likely to find a match, but the search could take longer.

Note that you can set MinSimilarity and both the record-level and also at the column-level for each individual column. Any match result return must meet the thresholds set at ALL levels and for ALL columns. For instance, you might set a record-level MinSimilarity of 0.5, but require that ZipCode has MinSimilarity 0.9 and Name has MinSimilarity 0.4. Fuzzy Lookup will only return results that meet all of those criteria.

That means in short, if you set it too high, you might not get any matches at all. I doubt that this is what leads to your NULL values since it is unlikely that all of the values are NULL only by this condition, even if it were set to 1.0, which I doubt as well since that would not be fuzzy but exact matching.

闻呓 2024-08-30 00:01:03

这可能是“IT Crowd”电视剧中的内容:您是否尝试过将其关闭然后再次打开?

对于 SSIS,这不仅仅意味着再次打开 Visual Studio,而是围绕查找重新构建每个框 - 以及查找框本身,即使它占用了您的时间 - 以便您删除而不仅仅是刷新它们。

请参阅如何避免将匹配列值之一中包含 NULL 的行传递给 KingswaySoft SSIS 插件中不匹配的行工具“高级查找”? - DBA SE 只能像这样修复。令人惊讶的是,元数据在每一步都是正确的,许多盒子已经被再次替换,没有显示错误,但仍然必须整体重新构建。

This might be something from the "IT Crowd" TV series: have you tried turning it off and on again?

For SSIS, that would not just mean to open Visual Studio again, but to re-build each box around the lookup - and also the lookup box itself even if it eats up your time - so that you delete and not just refresh them.

See How do I avoid passing a row with a NULL in one of the matching column values to the unmatched rows in KingswaySoft SSIS Add-In tool "Premium Lookup"? - DBA SE which could be fixed only like this. Astonishingly, the metadata was right at every step, many boxes were already replaced again, no error shown, and still, it had to be re-built as a whole.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文