From user-return-25368-apmail-ignite-user-archive=ignite.apache.org@ignite.apache.org Wed Mar 20 15:01:15 2019 Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C5A9A1947A for ; Wed, 20 Mar 2019 15:01:14 +0000 (UTC) Received: (qmail 167 invoked by uid 500); 20 Mar 2019 15:01:14 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 108 invoked by uid 500); 20 Mar 2019 15:01:14 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 99995 invoked by uid 99); 20 Mar 2019 15:01:14 -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 Mar 2019 15:01:14 +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 C4C74C6839 for ; Wed, 20 Mar 2019 15:01:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, 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, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id T6LTC1GgfXTU for ; Wed, 20 Mar 2019 15:01:08 +0000 (UTC) Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 47B965F66C for ; Wed, 20 Mar 2019 15:01:08 +0000 (UTC) Received: by mail-vs1-f47.google.com with SMTP id w13so1678126vsc.4 for ; Wed, 20 Mar 2019 08:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=u702BvPozVmOSTutP2eJYESyWRboCteDz/9Ql5LkM1Q=; b=gUG5lWaemco8YPcYg1RFJEaYFnxmcOiH6uZC7Kaj+8AxzEnH4nlBrCVM0KueR8V5+X X51XgOMOEvdCY63TVge7XP4+jRqKOw8lgSqf7NMwCECIqBZKap/xkYNnrG/Hkur1K/FB CEFCaK6oblCym2nrsqdXwIYczGXcivMKbroyaMwacvVQ7BhslACjco8EK4brmkNY8809 oxf++jOyAm1XQgdzZg1nXKxYaFR8eMB2jEvGVfyXPdfUK2tOweLV3cBpSuEtcMUSbokF 0OL64djtXTgKKW2qqahEzBKMO8AbEx7go3aAzWUk/24Z0bFrx/jiNs+hdTF8459F2hfc WZFg== 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=u702BvPozVmOSTutP2eJYESyWRboCteDz/9Ql5LkM1Q=; b=Y+7O5lw1eUFXuo39okUsCUuZENTYdM2EQiGPuZfZPvd8ML/6m2lO7kVRa4RFgG3Y0F GkR5BkM2rcqpHfrferCGMafEhEmbXxU0wMjS982DHRBxF6hdsrspl0S+Kq2HWhexRoKD wJHepGu7KVy8jhF2hCaWuTKQuEiqNhxxft4r6kE3oy7g3vwpD86lsfCvgpcT7WVlD8vp RrapVqaQx7EmW88wioj96cZQ7y0mjT0AyHzzERU+tTpdJ9QYdHn3ERGNwPMNnOzb2vCr q9gzl/H67S4/DToIxl6inJwohz32IFY5OF/SuNqjkKLck0C77FfG8mmCcTnGAuh5pxgW cAkg== X-Gm-Message-State: APjAAAVz7xDLXa6xwWKvYfy0sdUmZ9C4lel4PJRWpYNit6BR7fonHNE8 TsnHu+Zo4XgtMRlwFPJVF/jUoJ6P8OiLyx5AOqKOLQ== X-Google-Smtp-Source: APXvYqymD6G1C4fPAWTp6lq/MAEPgGewe110rMzfXLLmh0qEoTDAqTvflWs4mBtJRrkEPCNJr1rbdo5R9xwgCOM6OdY= X-Received: by 2002:a67:ba0c:: with SMTP id l12mr4903175vsn.43.1553094060476; Wed, 20 Mar 2019 08:01:00 -0700 (PDT) MIME-Version: 1.0 References: <1552654342396-0.post@n6.nabble.com> In-Reply-To: From: Ilya Kasnacheev Date: Wed, 20 Mar 2019 18:00:48 +0300 Message-ID: Subject: Re: Access a cache loaded by DataStreamer with SQL To: user@ignite.apache.org Content-Type: multipart/alternative; boundary="000000000000c70beb058487e3ee" --000000000000c70beb058487e3ee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello! I don't understand what you are doing here. Why do you have two employee tables here? What is desired table structure? Regards, --=20 Ilya Kasnacheev =D1=81=D1=80, 20 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. =D0=B2 16:44, Mike Needha= m : > I have that part, what I dont understand is how I can create multiple > "Tables" within a Cache(Schema)? I have the following code that is using= a > simple Employee Class. > > IgniteCache testCache =3D > ignite.getOrCreateCache(new CacheConfiguration<>("MAIN") > .setIndexedTypes(Long.class, Employee.class) > .setQueryEntities(Collections.singleton( > new QueryEntity(Integer.class, > String.class).setTableName("EMPLOYEE")))); > Employee e =3D new Employee(1, "Test", 123.34f, 3); > try (IgniteDataStreamer ds =3D > ignite.dataStreamer("MAIN")) { > ds.addData(1l, e); > } > > how would one go about adding a second "Table" to the MAIN cache so that > it is queryable from DBeaver or other tools? > > > On Wed, Mar 20, 2019 at 4:29 AM Ilya Kasnacheev > wrote: > >> Hello! >> >> Please take a look at >> https://apacheignite.readme.io/docs/cache-queries#section-query-configur= ation-by-annotations >> >> Regards, >> -- >> Ilya Kasnacheev >> >> >> =D0=B2=D1=82, 19 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. =D0=B2 20:25, Mike Nee= dham : >> >>> Do you have an example of how that could be done. I am struggling to >>> figure out how to set this up. >>> >>> On Mon, Mar 18, 2019 at 2:00 AM Ilya Kasnacheev < >>> ilya.kasnacheev@gmail.com> wrote: >>> >>>> Hello! >>>> >>>> The best approach is to use .setIndexedTypes() instead of >>>> setQueryEntities(), and annotate complex types in question with >>>> @QuerySqlField. >>>> This way you can then pour those types into cache and it will work >>>> transparently. >>>> >>>> Regards, >>>> -- >>>> Ilya Kasnacheev >>>> >>>> >>>> =D0=BF=D1=82, 15 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. =D0=B2 18:28, Mike N= eedham : >>>> >>>>> Perfect, now the next question is how would you do this for a more >>>>> complex object/table? Either one defined in a separate object or via= SQL >>>>> DDL? >>>>> >>>>> On Fri, Mar 15, 2019 at 9:05 AM Ilya Kasnacheev < >>>>> ilya.kasnacheev@gmail.com> wrote: >>>>> >>>>>> Hello! >>>>>> >>>>>> You will have to specify schema name (or cache name?) in ALLCAPS whe= n >>>>>> creating cache. >>>>>> >>>>>> Regards, >>>>>> -- >>>>>> Ilya Kasnacheev >>>>>> >>>>>> >>>>>> =D0=BF=D1=82, 15 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. =D0=B2 16:45, Mike= Needham : >>>>>> >>>>>>> I see. did not have the "person" for the schema. Is there a way t= o >>>>>>> not have the quotes around that? >>>>>>> >>>>>>> On Fri, Mar 15, 2019 at 7:59 AM ilya.kasnacheev < >>>>>>> ilya.kasnacheev@gmail.com> wrote: >>>>>>> >>>>>>>> Hello! >>>>>>>> >>>>>>>> Definitely works for me in DBeaver with this exact code: >>>>>>>> >>>>>>>> < >>>>>>>> http://apache-ignite-users.70518.x6.nabble.com/file/t1312/dbeaver-= tables.png> >>>>>>>> >>>>>>>> >>>>>>>> Some of DBeaver's introspection does not work but statements are >>>>>>>> solid. >>>>>>>> >>>>>>>> Regards, >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> *Some days it just not worth chewing through the restraints* >>>>>>> >>>>>> >>>>> >>>>> -- >>>>> *Some days it just not worth chewing through the restraints* >>>>> >>>> >>> >>> -- >>> *Some days it just not worth chewing through the restraints* >>> >> > > -- > *Some days it just not worth chewing through the restraints* > --000000000000c70beb058487e3ee Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

I don't understan= d what you are doing here. Why do you have two employee tables here? What i= s desired table structure?

Regards,
=
--
Ilya Kasnacheev

<= /div>
= =D1=81=D1=80, 20 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. =D0=B2 16:44, Mike Needha= m <needbrew@gmail.com>:
=
I have that part, what I dont understand is how I can create= multiple "Tables" within a Cache(Schema)?=C2=A0 I have the follo= wing code that is using a simple Employee Class.

= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 IgniteCache<Object, Object>= testCache =3D ignite.getOrCreateCache(new CacheConfiguration<>("= ;MAIN")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setIndexedTypes(Long.class, Employee.c= lass)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 .setQueryEntities(Collections.singleton(
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new = QueryEntity(Integer.class, String.class).setTableName("EMPLOYEE")= )));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Employee e =3D new= Employee(1, "Test", 123.34f, 3);
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 try (IgniteDataStreamer<Long, Employee> ds =3D i= gnite.dataStreamer("MAIN")) {
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ds.addData(1l, e);
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0
how would one go abo= ut adding a second "Table" to the MAIN cache so that it is querya= ble from DBeaver or other tools?


On Wed, Mar 20, = 2019 at 4:29 AM Ilya Kasnacheev <ilya.kasnacheev@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">

=D0=B2=D1=82, 19 =D0=BC=D0=B0=D1= =80. 2019 =D0=B3. =D0=B2 20:25, Mike Needham <needbrew@gmail.com>:
Do you have an e= xample of how that could be done.=C2=A0 I am struggling to figure out how t= o set this up.

On Mon, Mar 18, 2019 at 2:00 AM Ilya Kasnacheev <ilya.kasnacheev@gma= il.com> wrote:
Hello!

The best approa= ch is to use .setIndexedTypes() instead of setQueryEntities(), and annotate= complex types in question with @QuerySqlField.
This way you can = then pour those types into cache and it will work transparently.
=
Regards,
--
Ilya Kasnacheev


=D0=BF=D1=82, 15 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. = =D0=B2 18:28, Mike Needham <needbrew@gmail.com>:
Perfect, now the next question is = how would you do this for a more complex object/table?=C2=A0 Either one def= ined in a separate object or via SQL DDL?=C2=A0=C2=A0

On Fri, Mar 15, 2019= at 9:05 AM Ilya Kasnacheev <ilya.kasnacheev@gmail.com> wrote:
Hello!

You will have to specify schema name (or cache name= ?) in ALLCAPS when creating cache.

Regards,
--
<= div dir=3D"ltr">Ilya Kasnacheev

=

= =D0=BF=D1=82, 15 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. =D0=B2 16:45, Mike Needha= m <needbrew@gmai= l.com>:
<= div dir=3D"ltr">I see.=C2=A0 did not have the "person" for the sc= hema.=C2=A0 Is there a way to not have the quotes around that?

On Fri, Mar 1= 5, 2019 at 7:59 AM ilya.kasnacheev <ilya.kasnacheev@gmail.com> wrote:
Hello!

Definitely works for me in DBeaver with this exact code:

<http://apache-ignite= -users.70518.x6.nabble.com/file/t1312/dbeaver-tables.png>

Some of DBeaver's introspection does not work but statements are solid.=

Regards,



--
Sent from: http://apache-ignite-users.70518.x6.nabbl= e.com/


--
Some days it just = not worth chewing through the restraints


--
Some days it just not worth chewing through the restraints


--
Some = days it just not worth chewing through the restraints =


--
Some days it just not worth chewing through the restraints<= /strong>
--000000000000c70beb058487e3ee--