Return-Path: X-Original-To: apmail-asterixdb-dev-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-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 F008618A4C for ; Tue, 26 Jan 2016 01:58:33 +0000 (UTC) Received: (qmail 57036 invoked by uid 500); 26 Jan 2016 01:58:33 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 56977 invoked by uid 500); 26 Jan 2016 01:58:33 -0000 Mailing-List: contact dev-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list dev@asterixdb.incubator.apache.org Received: (qmail 56964 invoked by uid 99); 26 Jan 2016 01:58:33 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jan 2016 01:58:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 123821A0426 for ; Tue, 26 Jan 2016 01:58:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.98 X-Spam-Level: ** X-Spam-Status: No, score=2.98 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=lambda-nu.20150623.gappssmtp.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id CDEkq9F0MDfD for ; Tue, 26 Jan 2016 01:58:30 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id F1B3442BC5 for ; Tue, 26 Jan 2016 01:58:29 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id c192so96204785lfe.2 for ; Mon, 25 Jan 2016 17:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lambda-nu.20150623.gappssmtp.com; s=20150623; h=mime-version:reply-to:sender:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=KkEfCusarw38DCAe0w7m+GoVAbG5c01CP2JSJ6nHyVI=; b=pFud3H0Qp0wQyXT1OWO3F9WHSxaG1Q+COzfEDylx4QPHX6nOhYkPciN9lUi8xFpt1X bBLFsO8OeC9ypyE8KUih4jwmh3/LVgaTQaHeN8YikhO2cggXuiKHaxkO/8CqvIz4iLUb DJvgBaV7mmxJITMd986uuKYpQBGE6CmxmrVzTwmZPChxztwPxisR7F//h3YsUrUPYflx 7dwSuzubBn8lcR43XIYsDB/B4xcIw6KfeOQwT5QoV5CK/srjBbb0lje4OrYBjazHdalv +vA80N0n3BbDSs2y7cJnYXB8rjF3ZsaJ8Qa5kzamkkNC7/izUcualFEKdCrE4u5Hvqbr 4Zww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:sender:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=KkEfCusarw38DCAe0w7m+GoVAbG5c01CP2JSJ6nHyVI=; b=kIVhKKaKXUAlbWbLVxx+XhfEd4FAr0dvrWEJwtfBqFJoYWqJIHabUYQMkn4lccfo42 IetxGLxo8LBW1HSqC05a60ipwdo2d+S2m2q4c5t4RhrNDgQcPe8WMyX9SdHcMtS5pgoa sj5eYx6YAJCZUxvLXPN/MyBxEL3pVUblwilYw3p5SaaOSHOvzaIiFlELoW+jF2d9gWRv N25EcYyRhP0H0EforJglFOYK1vbdAVIvrKjTijIcoIfK87E1yBCYZ739U2c8Lq/ct3Ke 07b777U1bl1zfUHPmRE5GwKD9Xr9616o/nnN+4X64PcsPzzLtr/LhieZPlWxWl8L+ovH BelQ== X-Gm-Message-State: AG10YOR6EBI3kpqP1ip3skONz40MQU9DX0lr3Qlhh6IZaaw+0detWrgPzvwqD/anuIltAPsBXiXpR1QzpTdY7g== X-Received: by 10.25.41.193 with SMTP id p184mr7690823lfp.150.1453773508832; Mon, 25 Jan 2016 17:58:28 -0800 (PST) MIME-Version: 1.0 Reply-To: chillery@hillery.land Sender: ceej@lambda.nu Received: by 10.25.135.87 with HTTP; Mon, 25 Jan 2016 17:58:09 -0800 (PST) X-Originating-IP: [69.62.207.190] In-Reply-To: <8DD3AA4E-5289-408D-8BB8-3B2EA03232CA@apache.org> References: <8DD3AA4E-5289-408D-8BB8-3B2EA03232CA@apache.org> From: Chris Hillery Date: Mon, 25 Jan 2016 17:58:09 -0800 X-Google-Sender-Auth: JdL8lPzqwSTHmmPSU40fuNTeUWk Message-ID: Subject: Re: Round Tripping ADM Interval Data To: dev@asterixdb.incubator.apache.org Content-Type: multipart/alternative; boundary=001a11410bda940e1b052a330529 --001a11410bda940e1b052a330529 Content-Type: text/plain; charset=UTF-8 I would vote for: d. Update the serialized format to output "interval-from-date" and put both dates in quotes. I like the function name interval-from-date() better, and I don't think there's any need to maintain backwards compatibility with the old name which clearly never worked. Couple thoughts, though: The serialized format really should be "ADM", not "AQL". As such I don't think it should reference functions at all. We already do this for many datatypes, such as uuid("...") and datetime("..."). Are those truly "Functions"? Are they "constructors", and is that different? In any case, the answer for interval types should be consistent with that. Final note: quite possibly the lossless-JSON and clean-JSON outputs for intervals are broken as well, and should be fixed. Ceej aka Chris Hillery On Mon, Jan 25, 2016 at 5:36 PM, Till Westmann wrote: > Voting for a. Seems to be the least redundant option. > > Cheers, > Till > > > On 25 Jan 2016, at 16:47, Eldon Carman wrote: > > The interval field value printed in the ADM results can not be used to >> create an interval. >> >> Intervals have several functions that are used to construct an interval: >> interval-from-date/time/datetime >> and interval-start-from-date/time/datetime. It appears that this is the >> only way to create an interval. Thus, a user must use one of these >> function >> to create an interval. >> >> The following query shows how to create three intervals. >> >> Query: >> let $di := {"date-interval": interval-from-date("2012-01-01", >> "2013-04-01")} >> let $ti := {"time-interval": interval-from-time("12:23:34.456Z", >> "233445567+0800")} >> let $dti := {"datetime-interval": >> interval-from-datetime("2012-01-01T12:23:34.456+08:00", >> "20130401T153445567Z")} >> return [$di, $ti, $dti]; >> >> Result: >> { "date-interval": interval-date("2012-01-01, 2013-04-01") }, { >> "time-interval": interval-time("12:23:34.456Z, 15:34:45.567Z") }, { >> "datetime-interval": interval-datetime("2012-01-01T04:23:34.456Z, >> 2013-04-01T15:34:45.567Z") } ] >> >> Notice the results show interval-date("date, date") which is different >> than >> the functions that are used to create a date interval. Notice that >> interval-date does not exists in AsterixDB and that the input is a single >> string of dates separated by a comma. Below are some ideas on how to >> create >> a round-trip for intervals. >> >> Options for round tripping: >> a: Rename "interval-from-date" to "interval-date" and update the output to >> put both dates in quotes. >> b: Add alias for "interval-from-date" to "interval-date" and update the >> output to put both dates in quotes. >> c: Create an interval date constructor (called interval-date) that can >> parse the string "date, date". >> >> The same process should be used for intervals with time and datetime. >> >> Thoughts? >> > --001a11410bda940e1b052a330529--