From user-return-1614-archive-asf-public=cust-asf.ponee.io@kudu.apache.org Wed Feb 20 18:25:51 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9826518075F for ; Wed, 20 Feb 2019 19:25:50 +0100 (CET) Received: (qmail 89378 invoked by uid 500); 20 Feb 2019 18:25:49 -0000 Mailing-List: contact user-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@kudu.apache.org Delivered-To: mailing list user@kudu.apache.org Received: (qmail 89363 invoked by uid 99); 20 Feb 2019 18:25:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2019 18:25:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id AC452CB742 for ; Wed, 20 Feb 2019 18:25:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.81 X-Spam-Level: * X-Spam-Status: No, score=1.81 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudera.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id pbdVbwZ8QEcz for ; Wed, 20 Feb 2019 18:25:47 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id CFE1B5F642 for ; Wed, 20 Feb 2019 18:25:46 +0000 (UTC) Received: by mail-wm1-f42.google.com with SMTP id n19so7609473wmi.1 for ; Wed, 20 Feb 2019 10:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudera.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=yqNkJmpTV5XfMUXfs3lEUfLPzWaiIUo20I7EG+ZLqeE=; b=WdzjxrHE43EjrcYgM1mi4ktr452SoQREGOPiAxnfsREEMLeJXs3miIFNPZw10q9gLG 3+VU8+nszAuHv5w+VGmSPiD3k90DkuaaRaWI9y0HYFuzIPcZq4OC0QAlSNoIX2QkWrQg eus6iUZxz/nlcD3aTfiww4yy+bSrbIGrifZYV0H2pIsN/HdEgdwgjgYwPmLsO37PBkGp frLVyjZSlm0266LJYmzvi9pNHINoU2uUB7Cq9Jc6X9rIbJKn1yvmcPtLPOCqJzLeNmcC 9PQy5WvURvz9kEp3NUueUOml1GuDE9464t8lDLNRaybf5HqPaQVA1Bf3e5ajXxmhsUcY dtNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=yqNkJmpTV5XfMUXfs3lEUfLPzWaiIUo20I7EG+ZLqeE=; b=YhE4LFFiC02krbmkyqK2KjlGNgFKl73m7o8Wg9W4cKSsR8ZVCi9phpu94GWhXhMf6D v2WTFdzV8UlbDSPCTk85iTuA8vbn0VzA4WtYJ4LzLjk2BYv6apUy/k/aMKm1CRV+LoxY wE77BIlYJVQernVJWDfX5GHbUuJmUqXdGeeKqpgRg0K0NupRg/m/+gIuusWbnlokUhLK ZIuLoRQQPD7EPB9EUxLieLcUqarJXFzlPeBLK9GdXY9XrBAucy0i7FOmX2mboeD4pUys 1kPyWZVRVvpSj4ZzKR6mAPOSpAo9oU/g9c91AtyWa6Z4apxWf/YgUD8PlvubfX+JKB2Y VNWQ== X-Gm-Message-State: AHQUAuY8Q60INoEYmftaorGZkUEShE5Vq+QX9ScRGdQxhilTXxoAPbuv OPKqZyWO8momiDXIysF5OBqtMozZIhsJXD7hdxW4ZGO2PXw= X-Google-Smtp-Source: AHgI3IYIKO7J7gEjehCwkdfLcQjDoV7R8Vn/Ud895x+jUF3ARXXreSqjgm0mBk4V8vFjkZWYvsMGLRazZAxW5vnHo8M= X-Received: by 2002:a1c:a986:: with SMTP id s128mr8109349wme.44.1550687139790; Wed, 20 Feb 2019 10:25:39 -0800 (PST) MIME-Version: 1.0 References: <002601d4c912$309962e0$91cc28a0$@corp.netease.com> In-Reply-To: From: Alexey Serbin Date: Wed, 20 Feb 2019 10:25:13 -0800 Message-ID: Subject: Re: Single value range partitions using the Java API To: user@kudu.apache.org Content-Type: multipart/alternative; boundary="0000000000002033cb0582577caf" --0000000000002033cb0582577caf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Nabeelah, If you are looking at some hints how to deduce range partition bounds the Impala-like way just from a single tuple, one starting point I could see is https://github.com/apache/impala/blob/b8a8edddcb727a28c2d15bdb3533a32454364= ade/fe/src/main/java/org/apache/impala/service/KuduCatalogOpExecutor.java#L= 178 Let me know if you need any other help with that. HTH, Alexey On Wed, Feb 20, 2019 at 5:28 AM Nabeelah Harris wrote: > It doesn't seem that I am able to use 'incrementColumn()' since it's not > public. I did however go ahead and add a suffix of 'Character.MAX_VALUE' = to > the string, and now the single value range partitions are being created > perfectly. > > Thank you! > > > > On Wed, Feb 20, 2019 at 1:48 PM helifu wrote: > >> Hi, >> >> It seems the range should be: >> [(123, 'abc'), (123, 'abc\0')) >> ^ ^ >> | | >> lower_bound upper_bound >> >> And the function 'incrementColumn()' here may help: >> >> https://github.com/apache/kudu/blob/3e3bd1ccbc2b4b070c733b36b1971de63977= 428b/java/kudu-client/src/main/java/org/apache/kudu/client/PartialRow.java#= L1311 >> >> >> =E4=BD=95=E6=9D=8E=E5=A4=AB >> 2018-10-24 15:17:53 >> >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- >> =E5=8F=91=E4=BB=B6=E4=BA=BA: user-return-1611-hzhelifu=3Dcorp.netease.co= m@kudu.apache.org >> =E4=BB=A3= =E8=A1=A8 Nabeelah >> Harris >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2019=E5=B9=B42=E6=9C=8820=E6=97=A5= 18:27 >> =E6=94=B6=E4=BB=B6=E4=BA=BA: user@kudu.apache.org >> =E4=B8=BB=E9=A2=98: Single value range partitions using the Java API >> >> Hi there >> >> Using Impala to interact with Kudu, one is able to add range partitions >> with single values, i.e 'VALUE =3D (123, =E2=80=9Cabc=E2=80=9D)'. How wo= uld I go about >> creating the same type of range partition using the Java API? >> >> When adding a new range partition, the Java API for >> 'AlterTableOptions.addRangePartition' expects lower and upper bound >> =E2=80=98PartialRow=E2=80=99 objects, where the upper bound must explici= tly be greater than >> the lower bound. >> >> Nabeelah=3D >> >> > > -- > Nabeelah Harris > nabeelah.harris@impact.com | > https://impact.com > > > > > --0000000000002033cb0582577caf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Nabeelah,

If you are looking at some hint= s how to deduce range partition bounds the Impala-like way just from a sing= le tuple, one starting point I could see is=C2=A0https://gi= thub.com/apache/impala/blob/b8a8edddcb727a28c2d15bdb3533a32454364ade/fe/src= /main/java/org/apache/impala/service/KuduCatalogOpExecutor.java#L178

Let me know if you need = any other help with that.


HTH,

Alexey

On Wed, Feb 20, 2019 at 5:28 AM Nabeelah = Harris <nabeelah.harris@im= pact.com> wrote:
It doesn't s= eem that I am able to use=C2=A0=C2=A0'incrementColumn()'=C2=A0since= it's not public. I did however go ahead and add a suffix of 'Chara= cter.MAX_VALUE' to the string, and now the single value range partition= s are being created perfectly.=C2=A0

T= hank you!=C2=A0

=C2=A0

On Wed, Feb 20, = 2019 at 1:48 PM helifu <hzhelifu@corp.netease.com> wrote:
Hi,

It seems the range should be:
=C2=A0 [(123, 'abc'), (123, 'abc\0'))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ^=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0^
=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0|
=C2=A0 =C2=A0lower_bound=C2=A0 =C2=A0 upper_bound

And the function 'incrementColumn()' here may help:
https://github.com/apac= he/kudu/blob/3e3bd1ccbc2b4b070c733b36b1971de63977428b/java/kudu-client/src/= main/java/org/apache/kudu/client/PartialRow.java#L1311


=E4=BD=95=E6=9D=8E=E5=A4=AB
2018-10-24 15:17:53

-----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6-----
=E5=8F=91=E4=BB=B6=E4=BA=BA: user-return-1611-hzhelifu=3Dcorp.netease.com@kudu.a= pache.org <user-return-1611-hzhelifu=3Dcorp.netease.com@kudu.apache.org> =E4=BB=A3=E8=A1=A8 Nabeelah Harris
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2019=E5=B9=B42=E6=9C=8820=E6=97=A5 18= :27
=E6=94=B6=E4=BB=B6=E4=BA=BA:
user@kudu.apache.org
=E4=B8=BB=E9=A2=98: Single value range partitions using the Java API

Hi there

Using Impala to interact with Kudu, one is able to add range partitions wit= h single values, i.e 'VALUE =3D (123, =E2=80=9Cabc=E2=80=9D)'. How = would I go about creating the same type of range partition using the Java A= PI?

When adding a new range partition, the Java API for 'AlterTableOptions.= addRangePartition' expects lower and upper bound =E2=80=98PartialRow=E2= =80=99 objects, where the upper bound must explicitly be greater than the l= ower bound.

Nabeelah=3D



--
Nabeelah Harris=
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A03D""

--0000000000002033cb0582577caf--