Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5656818631 for ; Mon, 25 Jan 2016 16:17:37 +0000 (UTC) Received: (qmail 28336 invoked by uid 500); 25 Jan 2016 16:17:37 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 28296 invoked by uid 500); 25 Jan 2016 16:17:37 -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 28284 invoked by uid 99); 25 Jan 2016 16:17:36 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jan 2016 16:17:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 89D68C0877 for ; Mon, 25 Jan 2016 16:17:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3 X-Spam-Level: *** X-Spam-Status: No, score=3 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id PAWFjcGMEoo7 for ; Mon, 25 Jan 2016 16:17:27 +0000 (UTC) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 53F0620974 for ; Mon, 25 Jan 2016 16:17:27 +0000 (UTC) Received: by mail-io0-f180.google.com with SMTP id g73so160069811ioe.3 for ; Mon, 25 Jan 2016 08:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=mL8Pt2RiY7s9MkBChyPFBLQG/2+QEb0EYzjkx7oxGnc=; b=eoER/nLvCur9ZOiKe9TjOkHGdSFAYoxdHnSxl8bHvXlk4gu4WkhkIfwJmX8xaxnH7l kWWzLkPLJlmkgB0MqvVwVfsjXK7A43+f+WSG2pSxA7s4x7Wcn9PdauQ1S5mdqELOVtME FNl5U/9ca+IcJzNVcoVhWXraYLQ1CFBCtKAKbFJ8JmM7F/oKEItLG9o0IKJy8Rts//TM uiuCU33T2ZuJdoir+mh6cmC4w8CKyWTAGZlpUXn5LkTn0k72CnJxjUIw7FJPG1urXYhs Dbg1BVztZIHA95wGwzGGZHu5Si3EYchcKuuQFt29F7h8F4+NfXn/ZuhLejQs8MEHzUlj jVEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=mL8Pt2RiY7s9MkBChyPFBLQG/2+QEb0EYzjkx7oxGnc=; b=JoFtSN7ZhEqz6Amx5WnWzpYrozVmxwaiqSkXUvK6nRFi2Ta2q+uHsnKTXdPDdBhp+B k1Sk/LFLr8PjLCrxJ3MwBmavS+f5ULDKs+1hx5VVyzt3ZVrQbDs5hP+N++yqhEzZJ07M u8L6y7eUVKgzVPDWOtbLSCyWw0kD0jnXUXJ4s9krV27F+jwCsDBTewxjUGmBfBRKFhkv tHHj7iEfRURVXuCzDzSX7KFUMmoKJmzfyYo0jqmkdETpgawg20HmWvJc0GoFnz6HS43w f1F6hmgsaq9JFXUPf26sfAoSdD/DmcUX4xgazF00GoQnnQTuL6zEoRd13xdM9GM1Xw5Y LyGg== X-Gm-Message-State: AG10YORRLcU0+uPzQDyrxXWkxnL5qnvN4YGdlr8f46uebBSbf//+9UelxnQuHt3mFwOaSb1lifvBObCxf5pvUdQ1 X-Received: by 10.107.8.20 with SMTP id 20mr20256670ioi.34.1453738646748; Mon, 25 Jan 2016 08:17:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.59.199 with HTTP; Mon, 25 Jan 2016 08:16:57 -0800 (PST) In-Reply-To: References: From: Pavel Tupitsyn Date: Mon, 25 Jan 2016 19:16:57 +0300 Message-ID: Subject: Re: Ignite SQL syntax: key fields, scalars, nested fields To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=001a113eacc4a2f3d3052a2ae7ea --001a113eacc4a2f3d3052a2ae7ea Content-Type: text/plain; charset=UTF-8 Thank you Sergi, more questions: - How do I get the result of an aggregate? Via Fields query? Will it always be a single value, or a value per node? - If field names are flattened, what are QueryEntity.aliases for? Javadoc talks about dot notation, I thought it is for nested fields. - What is the purpose of SqlQuery.type? We use simple name of the class for it everywhere. Does it relate to type id mapping somehow? - I tried to use _key/_val aliases and could not get them to work: * "_val.Age > ?": Failed to parse query: SELECT "cache".QueryPerson._key, "cache".QueryPerson._val FROM "cache".QueryPerson WHERE _val.Age > ? * "_key > ?": Caused by: org.h2.jdbc.JdbcSQLException: Deserialization failed, cause: "class org.apache.ignite.binary.BinaryObjectException: Not enough data to read the value [position=1, requiredBytes=4, remainingBytes=0]"; SQL statement: SELECT "cache".QUERYPERSON._KEY __C0, "cache".QUERYPERSON._VAL __C1 FROM "cache".QUERYPERSON WHERE _KEY > ?1 [90027-175] On Mon, Jan 25, 2016 at 6:38 PM, Sergi Vladykin wrote: > - Yes, in SQL it is possible to query cache key and value using aliases > _key and _val respectively. > - Aggregate functions like SUM, AVG, MIN, MAX are supported. > - Nested fields are supported and they are flattened, so name collisions > are prohibited. > > Sergi > > 2016-01-25 15:26 GMT+03:00 Pavel Tupitsyn : > > > Igniters, > > > > In relation to .NET LINQ task [1], I'd like to know as much as possible > > about Ignite-specific SQL syntax. Our docs [2] do not cover everything. > > > > * Is it possible to query cache keys? E.g. "key > 10", or "key.field = > 1"? > > * Is it possible to query scalars, like "sum()"? > > * What about nested fields? From examples, I see that nested fields get > > flattened, so instead of Address.Zip you can just use Zip. Are there any > > limitations? What if there is field name collision? > > > > Where should I look to understand this better? > > > > Thanks. > > > > [1] https://issues.apache.org/jira/browse/IGNITE-1630 > > [2] https://apacheignite.readme.io/docs/sql-queries > > > > -- > > -- > > Pavel Tupitsyn > > GridGain Systems, Inc. > > www.gridgain.com > > > -- -- Pavel Tupitsyn GridGain Systems, Inc. www.gridgain.com --001a113eacc4a2f3d3052a2ae7ea--