From user-return-22986-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Sat Nov 17 15:08:45 2018 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 55FAA180658 for ; Sat, 17 Nov 2018 15:08:45 +0100 (CET) Received: (qmail 95679 invoked by uid 500); 17 Nov 2018 14:08:44 -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 95669 invoked by uid 99); 17 Nov 2018 14:08:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Nov 2018 14:08:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CE5B7180A3E for ; Sat, 17 Nov 2018 14:08:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.076 X-Spam-Level: ** X-Spam-Status: No, score=2.076 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-1.459, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_REPLY=1, HTML_IMAGE_ONLY_28=0.726, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id mdu-_IqiviAW for ; Sat, 17 Nov 2018 14:08:42 +0000 (UTC) Received: from sonic308-2.consmr.mail.bf2.yahoo.com (sonic308-2.consmr.mail.bf2.yahoo.com [74.6.130.41]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id CA617623F6 for ; Sat, 17 Nov 2018 13:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1542462210; bh=ytb0ZxUrhd7W9XSdNy9abEWTzoiVa521WO/tkuMSQOg=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=Nd1PZxNa0mqps41dfDG3TPEcE7UVIaM/Ffwvxc5WWhmT5NPZFuagAyoDYZJqPxTO2tweswgZifk113hALNWJqL73Jas7hecJ3LuJBFseQEXve8AE4Y8VrtkTMcfh7/h9E7I+2VGeE6GqQgfxL2zanjdjrP27qnlsJXchOY1bvPVgzGHAiFmCFxyy8Q4Vqz8vJyyrTE7G9zJGfl9C0EFaPWSxD3kq4EabV3A8uZ/pF4xBex1b+GeMT+5pOtIrDHJTkMGZZIFMpbd1cGQ3jv7oupVtrDtwjhi2saeLdqQg11gnE176QuPV6FuFw/GlAg/YRqR0MJ/O6HnrE4h1GtDfkQ== X-YMail-OSG: aoF10zsVM1lo3r.PH7N5slxqojDPb7nNuowX0Glo7Zb.8PvPYRzRClcpxtMHsyy SR8DhOxGOZr7Cq8rg_nAhVpEe4nv2sTYHXXyAOpckjbDqgKDSU.undIx4lpMHnSvs2I4CRQdQ5KS bkt9doFgw7dU.ARFRMQmisbCBvFm8jTjsovQ4jk68Hyeclk5rPhl6IooUGe4s2X8tZ2.J0PIUhac UtIiaTpNywmPxJbgJAdCiwSBVlx3sOri4bX140rX5Db864E4hvpoLHIeYZ8HN2njavgqtIfdt2L4 czB0xK1WXdOgbfYhq0U78wg71E45dfidBlCVY9IoMSZ3zLA7hi1u.Q.3mkMaJfXQzCZj44VRAAIe nqbN5KW4dcqx7kSPFFoqs.GqJ9NugyUCPqqhi5gT5RhK9l92r8Z.wLWu35aDhUxInMRe.Xppk2VE fRkQfCAn4W2GsvCbUODoLPnsyGfsPzJDeHADohTKWZgfGuf7ZfQ2_.rpttto86AL9_BZzaMarZKr WvwVyRzjramFMmTQn9e_bDEJJue0FSfwt85.u9X49hmWgkoSP74seRCBe4xFSAjTmx3oMMVzR4e8 0B_MeO6mMyjR1gXcVs0ISllqx9O3cCzQZorTmjYRAcCl1qfuYU8PB9bXDQPhVwuhHK3dNvXOllNd HBPwZ0Q.N0HXGxaQctl1OGOlgFN8izjqfJ5nr5xruuGvUoNTpXqbastuGOAUFtvx8yC7Pf7Hok1D lGPh1NleY2tFQdC.Z2mpGuXwbzsr.vFDeVRPmPqlggOvfZ9ihk2vW9JGqHGxfwtl4ESuL1XArDNt PFhL4ZGy_GpnEkuveNUqLADvlD6l9pg49OP1pwXv4aZ_MZIun5kXoEsXGX.deu_OyBx9nfOJg4Aa _WwHY2bTooEgpoMHqrfcnCRqURmTMEv8lBBFPvnwwA3QnI.xnumDU31nGPT1BCS_Z9JN0I41Rxcw HHQAWFjgEx.BfNwhumTAG3Hpw4C0ufpr4A5yFBpqZzB7BcugeBi0pIMjJAL9lO6eiG4WJ1JanAN5 ywpjxkMjR9Nm5uAdB8shqfiBgrngGfoDmuNJgNYGksfe48kIS0D23NJ3KtYLNVywu.g21BesGlPh R1pAzDmWXalPpqkEJHg9CmBCJjxDI90OD1QH_6odsi3tJSNVi4ZjMogqTsKD_kHSINmzNeFP4jm9 pZE07chyBy.0rCptp1jslfBVVu2W32cI.FxCzkrAaJqVY Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.bf2.yahoo.com with HTTP; Sat, 17 Nov 2018 13:43:30 +0000 Received: from pool-98-113-33-62.nycmny.fios.verizon.net (EHLO GP01) ([98.113.33.62]) by smtp403.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID cb9dadcbbba63b725aa7e2676472b7e6 for ; Sat, 17 Nov 2018 13:43:29 +0000 (UTC) Date: Sat, 17 Nov 2018 08:43:28 -0500 From: Peter Sham To: "=?utf-8?Q?user=40ignite.apache.org?=" Cc: siva Message-ID: <1542461644.local-9c4bedcc-4679-v1.5.2-31660462@getmailspring.com> In-Reply-To: References: Subject: Re: How to get the column names(or fieldsNames) of existing ignite sql table X-Mailer: Mailspring MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5bf01b00_58f5bd4f_163c" --5bf01b00_58f5bd4f_163c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I don't think you can get all the tables created in a cache by SQL. I'm learning this stuff and hit the same questions and figure I can find it out by the following steps in code (I'm coding c# and don't know if the methods apply in Java). Get all cache names from IIgnite by GetCachenames() Loop through all the caches in getting them one by one by IIgnite.GetCache() Get the cache configuration by GetConfiguration on IICache Loop through QueryEntities on cache configuration Each QueryEntity would hold the table name, even with those created by SQL. In fact, within QueryEntity you will have Fields which are the columns. And for question 2, I think, yes, from my learning, SQL Create Table always create another cache with default naming like SQL_PUBLIC_. But according to manual, you can override the name by supplying options after "with". Happy Coding! Peter Sham sham.peter@gmail.com (https://link.getmailspring.com/link/1542461644.local-9c4bedcc-4679-v1.5.2-31660462@getmailspring.com/0?redirect=mailto%3Asham.peter%40gmail.com&recipient=dXNlckBpZ25pdGUuYXBhY2hlLm9yZw%3D%3D) On Nov 17 2018, at 5:42 am, Dmitry Lazurkin wrote: > > Hello. > On 17.11.2018 13:25, siva wrote: > > Quetions: > > ======= > > 1.How to get the existing table columnNames ? > > > > i am trying to use this query but its throwing exception > > *select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where > > TABLE_NAME='Person'* > > > You need query with setLocal(true). I don't known how to do this with > thin client. > --5bf01b00_58f5bd4f_163c Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hello,

I don't think you can get all the tables create= d in a cache by SQL. I'm learning this stuff and hit the same questions = and figure I can find it out by the following steps in code (I'm coding c= =23 and don't know if the methods apply in Java).
  1. Get a= ll cache names from IIgnite by GetCachenames()
  2. Loop th= rough all the caches in getting them one by one by IIgnite.GetCache<ob= ject, object>()
  3. Get the cache configuration by GetC= onfiguration on IICache
  4. Loop through QueryEntities on = cache configuration
  5. Each QueryEntity would hold the ta= ble name, even with those created by SQL.
In fact, wi= thin QueryEntity you will have =46ields which are the columns.

<= div>And for question 2, I think, yes, from my learning, SQL Create Table = always create another cache with default naming like SQL=5FPUBLIC=5F<t= able name>. But according to manual, you can override the name by sup= plying options after =22with=22.
Happy Coding=21

<= br>
Peter Sham
On Nov 17 2018, at 5:42 am, Dmitry Lazurkin= <dilaz03=40gmail.com> wrote:

Hello.=

On 17.11.2018 13:25, siva wrote:
Que= tions:
=3D=3D=3D=3D=3D=3D=3D
1.How to get the existin= g table columnNames =3F

i am trying to use this query but i= ts throwing exception

*select COLUMN=5FNAME from IN=46ORMAT= ION=5FSCHEMA.COLUMNS where
TABLE=5FNAME=3D'Person'*

You need query with setLocal(true). I don't known how to = do this with
thin client.
3D=22Open --5bf01b00_58f5bd4f_163c--