Rhino eTL:与孤立行的连接操作

发布于 2024-10-13 04:44:49 字数 254 浏览 3 评论 0原文

我是第一次在项目中使用rhino ETL,我非常喜欢 对其能力印象深刻。我使用连接操作来匹配两个 数据源。

有时可能会丢失数据,因此我将 LeftOrphanRow 重写为 “记录”错误。所以我想我会抛出一个异常然后在 流程结束时使用收集所有发生的异常 GetAllErrors()。

但似乎除了第一个例外之外,该过程正在中止。 这是故意的吗?最好的处理方式是什么 OrphanRows(特别是当我想在流程结束时获得所有操作的所有孤立行的摘要时)?

I'm using rhino ETL for the first time in a project, and I'm very
impressed by its capabilities. I use a join-operation to match two
datasources.

Sometimes there might be missing data, so I override LeftOrphanRow to
"log" the error. So I though I would throw an exception and then at
the end of the process collect all occured exceptions using
GetAllErrors().

But as it seems the process is being aborted with the first exception.
Is that intentionally? What would be the best way to deal with
OrphanRows (especially when I would like to have a summary of all orphan rows for all operations at the end of the process)?

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

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

发布评论

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

评论(1

败给现实 2024-10-20 04:44:49

在我看来,问题在于您试图使用异常来报告非异常事件。这并不是异常的真正用途,当然,当您期望异常通过第三方库传递时,您不应该依赖该库以任何特定方式处理该异常。

您是否可以在某个地方(例如全局)保留一个孤立行列表,并在任何连接操作中遇到孤立行时将其添加到其中?然后,在 EtlProcess 完成后,只需打印列表即可。您也可以考虑使用 log4net 来完成此任务。或者甚至只是发起一个活动,您可以在其他地方订阅并做任何看起来合适的事情。

Seems to me that the problem is that you're trying to use exceptions to report a non-exceptional event. That's not really what exceptions are for, and certainly when you're expecting the exception to pass through a third-party library, you shouldn't rely on that library to behave in any specific way with respect to that exception.

Can you just keep a list of orphan rows somewhere, e.g. globally, and add to it whenever you encounter one in any of your join operations? Then after your EtlProcess is finished, just print the list out. You might also consider using log4net to accomplish this. Or even simply raising an event, that you subscribe to elsewhere and do whatever seems appropriate.

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