Rhino eTL:与孤立行的连接操作
我是第一次在项目中使用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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,问题在于您试图使用异常来报告非异常事件。这并不是异常的真正用途,当然,当您期望异常通过第三方库传递时,您不应该依赖该库以任何特定方式处理该异常。
您是否可以在某个地方(例如全局)保留一个孤立行列表,并在任何连接操作中遇到孤立行时将其添加到其中?然后,在 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.