Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 26201200CE1 for ; Thu, 31 Aug 2017 23:37:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2492F16BFFD; Thu, 31 Aug 2017 21:37:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 69CA616BFFB for ; Thu, 31 Aug 2017 23:37:33 +0200 (CEST) Received: (qmail 42598 invoked by uid 500); 31 Aug 2017 21:37:32 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 42587 invoked by uid 99); 31 Aug 2017 21:37:32 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2017 21:37:32 +0000 Received: from [192.168.1.64] (108-193-4-186.lightspeed.sntcca.sbcglobal.net [108.193.4.186]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 0BA171A0029 for ; Thu, 31 Aug 2017 21:37:31 +0000 (UTC) From: Denis Magda Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: CREATE TABLE usage from Java API, .NET, C++ Date: Thu, 31 Aug 2017 14:37:30 -0700 References: To: dev@ignite.apache.org In-Reply-To: Message-Id: <1CCB785A-0CB4-4C16-A177-121ACD35058B@apache.org> X-Mailer: Apple Mail (2.3273) archived-at: Thu, 31 Aug 2017 21:37:34 -0000 I knew we discussed this some day ago. Put a reference to this = discussion into the ticket. It=E2=80=99s a good example of a usability = issue we can solve with the new API. =E2=80=94 Denis > On Aug 30, 2017, at 2:51 AM, Vladimir Ozerov = wrote: >=20 > Folks, >=20 > Please see this [1] and this [2]. >=20 > [1] > = http://apache-ignite-developers.2346864.n4.nabble.com/Rethink-native-SQL-A= PI-in-Apache-Ignite-2-0-td14335.html > [2] https://issues.apache.org/jira/browse/IGNITE-4701 >=20 > On Wed, Aug 30, 2017 at 3:10 AM, Valentin Kulichenko < > valentin.kulichenko@gmail.com> wrote: >=20 >> Ideally, SQL API has to be completely decoupled from cache API. = Otherwise >> we will keep getting issues like this. >>=20 >> let's introduce top level API (IgniteSql?) and add everything there. >>=20 >> -Val >>=20 >> On Tue, Aug 29, 2017 at 7:47 PM Denis Magda = wrote: >>=20 >>> Igniters, >>>=20 >>> Not sure we discussed this before, so let me start a new thread. >>>=20 >>> It=E2=80=99s claimed the command is supported from native Java, = .NET, C++ APIs >> but >>> I had hard time trying to use it from there. Imagine this simple >> statement >>> to be called from Java source code: >>>=20 >>> SqlFieldsQuery query =3D new SqlFieldsQuery( >>> "CREATE TABLE City (" + >>> " id LONG PRIMARY KEY, name VARCHAR)" + >>> " WITH \"template=3Dreplicated\""); >>>=20 >>> *cache*.query(query).getAll(); >>>=20 >>> The CT command will be recognized but the *cache* is not the City = cache. >>> It=E2=80=99s some other cache existed prior the query execution. >>>=20 >>> In my scenario I=E2=80=99ve planned to show how to configure the = schema from >>> scratch on an empty cluster and had to apply the following = workaround >>> instantiating a dummy cache: >>>=20 >>> IgniteCache cache =3D ignite.getOrCreateCache(new >>> CacheConfiguration<>("default").setIndexedTypes(Long.class, >>> Long.class).setSqlSchema("PUBLIC")); >>>=20 >>>=20 >>> How do we want to improve this poor experience? My options are: >>>=20 >>> 1) Introduce some static API (cache-reference-free) method for = quiries >>> like that. >>> 2) Deploy the cache prior that call and pass its name into = =E2=80=9CWITH=E2=80=9D >>> statement. >>>=20 >>> =E2=80=94 >>> Denis >>=20