kudu-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adar Lieber-Dembo <a...@cloudera.com>
Subject Re: Check existing range partitions using the Java API
Date Wed, 06 Mar 2019 05:58:22 GMT
Here are some other options:
1. Use the new KuduPartitioner class, available in master but not yet
in any releases. Given a PartialRow (i.e. a row to be inserted), you
can find its "partition index" and, more importantly for your use
case, receive an exception if no partition exists for the row.
2. Insert the data anyway, and rely on per-row errors to tell you that
a partition is missing. This is a more "optimistic" approach, but a
somewhat expensive one at that.

Would either of these work for you?

On Tue, Mar 5, 2019 at 6:33 AM Nabeelah Harris
<nabeelah.harris@impact.com> wrote:
> Hi there
> Currently, the only method available on KuduTable to check which
> partitions already exist is 'KuduTable.getFormattedRangePartitions'.
> This however looks to be experimental and only intended for use by
> Impala. Other than replicating the logic used in the above-mentioned
> method, is there any way I can easily retrieve the range partitions
> (or partitions at all) using the Java API? My use-case at the moment
> is to create range partitions based on the data I am about to insert,
> and to do so I want to first check if that range partition already
> exists, to prevent errors.
> Thanks
> Nabeelah

View raw message