You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kudu.apache.org by Boris Tyukin <bo...@boristyukin.com> on 2018/12/28 14:11:52 UTC

getRowErrors and operation type (insert, delete or update)

Hi guys,

I need to write some custom logic to handle Kudu exceptions in
AUTO_FLUSH_BACKGROUND mode and I can get what I need from
session.getPendingErrors().getRowErrors() except operation type (insert,
delete or update).

getRowErrors returns an array of RowError
https://kudu.apache.org/apidocs/org/apache/kudu/client/RowError.html

I can get error status code and error message, but I also need to know
operation type. There is RowError.getOperation() method that returns
Operation and I can also get PartialRow from Operation but I still cannot
figure out how to get operation type on that row.

Is it possible?

Thanks and a Happy New Year!
Boris

Re: getRowErrors and operation type (insert, delete or update)

Posted by Boris Tyukin <bo...@boristyukin.com>.
never mind, figured it out. I can do  RowError.getOperation().getClass() or
even simpler RowError.getOperation().getChangeType().

I love how clean Kudu API is!

On Fri, Dec 28, 2018 at 9:11 AM Boris Tyukin <bo...@boristyukin.com> wrote:

> Hi guys,
>
> I need to write some custom logic to handle Kudu exceptions in
> AUTO_FLUSH_BACKGROUND mode and I can get what I need from
> session.getPendingErrors().getRowErrors() except operation type (insert,
> delete or update).
>
> getRowErrors returns an array of RowError
> https://kudu.apache.org/apidocs/org/apache/kudu/client/RowError.html
>
> I can get error status code and error message, but I also need to know
> operation type. There is RowError.getOperation() method that returns
> Operation and I can also get PartialRow from Operation but I still cannot
> figure out how to get operation type on that row.
>
> Is it possible?
>
> Thanks and a Happy New Year!
> Boris
>