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 5DF2B18C5B for ; Tue, 26 Jan 2016 03:07:34 +0000 (UTC) Received: (qmail 65422 invoked by uid 500); 26 Jan 2016 03:07:34 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 65364 invoked by uid 500); 26 Jan 2016 03:07:34 -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 65353 invoked by uid 99); 26 Jan 2016 03:07:34 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jan 2016 03:07:34 +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 8F189C0D93 for ; Tue, 26 Jan 2016 03:07:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.446 X-Spam-Level: ** X-Spam-Status: No, score=2.446 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RP_MATCHES_RCVD=-0.554, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-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 CxtkzazwsdwX for ; Tue, 26 Jan 2016 03:07:26 +0000 (UTC) Received: from mx1.ucr.edu (mx1.ucr.edu [138.23.248.2]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 5A6A231AC0 for ; Tue, 26 Jan 2016 03:07:25 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DVAQAy4qZWlbTZVdFegm6CCwaIUZ5UCgaBDYsOiQqGDwKBRAc8EAEBAQEBAQERAQEBAQcNCQkfMIRBAQEBAwESEVsLCwsNKgICIhIBBQEcGSKHcQihSIExPjGLNItOAYNMAQseCoVghDKBA4dMgToFjSsBdIhRB4scgjqBXhaNBYVxhxQRH4ENN4IsEQeBcRsuhzwBAQE X-IPAS-Result: A2DVAQAy4qZWlbTZVdFegm6CCwaIUZ5UCgaBDYsOiQqGDwKBRAc8EAEBAQEBAQERAQEBAQcNCQkfMIRBAQEBAwESEVsLCwsNKgICIhIBBQEcGSKHcQihSIExPjGLNItOAYNMAQseCoVghDKBA4dMgToFjSsBdIhRB4scgjqBXhaNBYVxhxQRH4ENN4IsEQeBcRsuhzwBAQE X-IronPort-AV: E=Sophos;i="5.22,347,1449561600"; d="scan'208,217";a="498649952" Received: from mail-lb0-f180.google.com ([209.85.217.180]) by smtp1.ucr.edu with ESMTP/TLS/RC4-SHA; 25 Jan 2016 19:07:17 -0800 Received: by mail-lb0-f180.google.com with SMTP id oh2so84801189lbb.3 for ; Mon, 25 Jan 2016 19:07:16 -0800 (PST) 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:date :message-id:subject:from:to:content-type; bh=bXkhWx7ZR6bbAgqRVe5mMG1WvmUq8KX0FXfwLLaoJfY=; b=akAPQj5WhdOVxAfjt+c0Yww+DJh5AZBIoCeQF+h0kMmRSaAyZKX2MwcStchI8yExxc VKZsqwaharZV4ANqhMg8t62+p/S2Eak16EbDF8CjfkmBzzq/wT5Dl5awAoi9M5fbe2My wwHyYMcPh4MrtR+3Sk1AjdMBiwX0SAHVdlr+r8Mr6miBuWy3zdBl5ZWNuL61Go6Mmv4N n1pqnj0tUKQW/VXAGx3NkPNgcYURhGehUHbO/uYeMhDLRut85fPfF48coOj7LY1TSbHN Lc6krd0bsJ2/diYi2DQlTDJQqw6Akfx2WjWueP4b4jhAr5MDp3qjV25bnTmxaZgG74nH 5GDA== X-Gm-Message-State: AG10YOR+hgjY0kEUy15JYSzmIX9OjdR7OPmDycy4xvg+2U/BpInmXXiMYI3hg5v1N1rMOJyOXuXxQtWhowYRZ+i+JESWAKcQ7oL/d9SReeJBPBE5KziVqrfV9RdTWvY6CiFSc6EFBm5n7Svkzhl7X4r5NS0DU+5DqVAIe2FD9Ap+ X-Received: by 10.112.166.100 with SMTP id zf4mr7627508lbb.58.1453777635381; Mon, 25 Jan 2016 19:07:15 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.166.100 with SMTP id zf4mr7627504lbb.58.1453777635270; Mon, 25 Jan 2016 19:07:15 -0800 (PST) Received: by 10.25.30.141 with HTTP; Mon, 25 Jan 2016 19:07:15 -0800 (PST) In-Reply-To: References: <8DD3AA4E-5289-408D-8BB8-3B2EA03232CA@apache.org> Date: Mon, 25 Jan 2016 19:07:15 -0800 Message-ID: Subject: Re: Round Tripping ADM Interval Data From: Eldon Carman To: dev@asterixdb.incubator.apache.org Content-Type: multipart/alternative; boundary=001a11c32f288879fc052a33fb2b --001a11c32f288879fc052a33fb2b Content-Type: text/plain; charset=UTF-8 Thanks Chris for adding a fourth option. This option would focus our updates to only the ADM output. Yes, both lossless-JSON and clean-JSON outputs would need to be check also. On Mon, Jan 25, 2016 at 5:58 PM, Chris Hillery wrote: > 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? > >> > > > --001a11c32f288879fc052a33fb2b--