Re: [Json] fun with streaming, was The names within an object SHOULD be unique.

Tatu Saloranta <tsaloranta@gmail.com> Sun, 04 August 2013 02:30 UTC

Return-Path: <tsaloranta@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5E15B11E80E8 for <json@ietfa.amsl.com>; Sat, 3 Aug 2013 19:30:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1owTbZICpsoZ for <json@ietfa.amsl.com>; Sat, 3 Aug 2013 19:30:08 -0700 (PDT)
Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) by ietfa.amsl.com (Postfix) with ESMTP id C10DF11E80D7 for <json@ietf.org>; Sat, 3 Aug 2013 19:30:07 -0700 (PDT)
Received: by mail-wg0-f48.google.com with SMTP id f12so1491248wgh.3 for <json@ietf.org>; Sat, 03 Aug 2013 19:30:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=F/INwHYwSMZ3nm+34y56UIin6l2nEiZIyx5helVnDfc=; b=mAbxVLq95WnmI4wOlTC0+9SxHYvoU9XeqiwHo6B3pp3Z90DbbEfuCoDLPkRuwU+2SB 3co0Bo8eTm5xA+uJrH3QVABkz1mp8EJvq6jEWuLgq/QG1jQ4pQOszV1h5LUJgMYhnC9u Nc1xlCh8fSCMX8PAnHXVadwZBNJy31YMufSzBI4cswqoK6UezeprLqT36aOnTyIy5W9N 4WgBDgP++eY4PALZy2KNWhTbcfmy4kfD/f1Jbu4AZKVnrqcx/iH33HxSH4ruPKCoQc0X V7MuQXUmNrUJmOg/oCu9ilSsnIIqEUlcyvUIFwMmJD4NiHLzjJPN4BGJLQK0vqA89KHL BhNg==
MIME-Version: 1.0
X-Received: by 10.194.78.110 with SMTP id a14mr9141484wjx.84.1375583406843; Sat, 03 Aug 2013 19:30:06 -0700 (PDT)
Received: by 10.216.233.196 with HTTP; Sat, 3 Aug 2013 19:30:06 -0700 (PDT)
In-Reply-To: <A723FC6ECC552A4D8C8249D9E07425A71417F804@xmb-rcd-x10.cisco.com>
References: <CAGrxA27ut1MoGLO-kdH1LXjA9Ct7jmvh0G5XDzfaV6AgtaOv5Q@mail.gmail.com> <A723FC6ECC552A4D8C8249D9E07425A71417F804@xmb-rcd-x10.cisco.com>
Date: Sat, 03 Aug 2013 19:30:06 -0700
Message-ID: <CAGrxA247usn3Cf5xZ_RMgSJt6RBgYapqzc7reHpwvB=HtzgOJw@mail.gmail.com>
From: Tatu Saloranta <tsaloranta@gmail.com>
To: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>
Content-Type: multipart/alternative; boundary="047d7bfcf01e52ebec04e315f84a"
Cc: John Levine <johnl@taugh.com>, Tim Bray <tbray@textuality.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] fun with streaming, was The names within an object SHOULD be unique.
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 04 Aug 2013 02:30:11 -0000

On Sat, Aug 3, 2013 at 4:09 PM, Joe Hildebrand (jhildebr) <
jhildebr@cisco.com> wrote:

> On 7/30/13 7:56 PM, "Tatu Saloranta" <tsaloranta@gmail.com> wrote:
>
> >This is a common use case for processing large JSON files; either output
> >as JSON arrays, or just sequences of space-separate objects. Typical data
> >sets are log output, processing from map/reduce style jobs and batch jobs.
>
> You're saying that you either produce
>
> {"a": 1, "b": 2} {"a": 3, "b": 4}
>
> or:
>
> [{"a": 1, "b": 2},{"a": 3, "b": 4}]
>
> right?  In neither of those cases does the producer have a problem
> ensuring name uniqueness.  If you've got a programming language
> description the objects in either of those cases, they are known to have
> unique names.  If you're parsing either of those as a stream and
> generating 2 events each, you'll have to deal with unique names in one of
> the four ways we've seen(*), but not when acting as an eventing parser,
> only when creating the programming language construct to hold the objects
> from the events fired.
>

Yes.


>
> >Separation between streaming part and higher layers is for good
> >separation of concern, as well as practical matter for reusing components.
>
> That is a perfectly valid design, yes.  I even like it.  It doesn't get
> away from the fact that when you reduce the events to objects in your
> programming language, you'll need to deal with duplicate names in one of
> the four ways.  Therefore, you SHOULD NOT send duplicates, since you don't
> know how they are going to be treated by the receiver.  If you control
> both ends of the conversation, then it doesn't matter what the standard
> says, and you can send any data you want, including duplicates.
>
>
(*) Reminder: error, first, last, all
>

Yes to all of above as well.

-+ Tatu +-