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 AFEDC1893A for ; Fri, 26 Jun 2015 06:25:43 +0000 (UTC) Received: (qmail 31193 invoked by uid 500); 26 Jun 2015 06:25:43 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 31140 invoked by uid 500); 26 Jun 2015 06:25:43 -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 31114 invoked by uid 99); 26 Jun 2015 06:25:43 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jun 2015 06:25:43 +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 D8CB3C095D for ; Fri, 26 Jun 2015 06:25:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.792 X-Spam-Level: * X-Spam-Status: No, score=1.792 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-1.108, 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=gmail.com 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 vvdMA0GqjsXD for ; Fri, 26 Jun 2015 06:25:33 +0000 (UTC) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com [209.85.218.48]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 4D4BF249C8 for ; Fri, 26 Jun 2015 06:25:32 +0000 (UTC) Received: by oigx81 with SMTP id x81so68800495oig.1 for ; Thu, 25 Jun 2015 23:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=M252FxCUzfKFuL9kMAX6I1EG7yHHmhU+x7qsiZ9u/DI=; b=m4LmRXtfNeQ7ptFQrPSkJkGTGQQ9FRVCr7Y9ru3vy2DBpoWCLRCgFnqZnZtRRVDbq2 NUaOxkAfMFH3sWMnHhPBRj2A0lv1QySnfOyvCmg50/EEhrwusyN/r/Ox8mRcoJAjy1sa Xbpz+wemo2ZFZZl4LYq8hgMMG4W+MJfeAB1bD+U6sqd6Lwb37NGI2WRzJWfLwztOBH4k nQ0dHoGFcUd48iSwa/X0EvWPE2//j8/UtW9a6m9fiOR+Dk/z1tM2kECK7JYJMy93cWVC IBacrqzVTp8IJMMb+HEuTlcp9GHVHwSuw7MxYNFT7/E8rpJ6ynHSC6scdpOfGrLb6BZN gKJA== X-Received: by 10.202.171.146 with SMTP id u140mr23436442oie.113.1435299931249; Thu, 25 Jun 2015 23:25:31 -0700 (PDT) Received: from mikejcarey.local (ip72-219-187-63.oc.oc.cox.net. [72.219.187.63]) by mx.google.com with ESMTPSA id y131sm17346054oig.28.2015.06.25.23.25.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 23:25:30 -0700 (PDT) Message-ID: <558CF059.9010509@gmail.com> Date: Thu, 25 Jun 2015 23:25:29 -0700 From: Mike Carey User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: dev@asterixdb.incubator.apache.org Subject: Re: Metadata names generation References: <308FDBD8-616C-4649-8824-C150B794D5F6@cs.ucr.edu> <56C5E538-F605-4AC3-B3AB-C05686B8DF44@cs.ucr.edu> In-Reply-To: Content-Type: multipart/alternative; boundary="------------050803080605050806030302" --------------050803080605050806030302 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Do folks not worry at all that . could be confusing in a name due to path expressions....? On 6/24/15 11:17 AM, Steven Jacobs wrote: > Fieldnames do allow these characters (both of them). > Steven > > On Wed, Jun 24, 2015 at 11:15 AM, Chen Li wrote: > >> I also prefer "." than "_". Also want to confirm that field names don't >> allow these two characters. >> >> Chen >> >> On Wed, Jun 24, 2015 at 10:52 AM, Steven Jacobs wrote: >> >>> I second Young-Seek (especially since this is the syntax that users will >>> use themselves for nested information in queries). >>> >>> Steven >>> >>> On Wed, Jun 24, 2015 at 10:40 AM, Young-Seok Kim >>> wrote: >>> >>>> It seems better to use "." instead of "_" since "." is more intuitive >> (at >>>> least to me) than "_". >>>> For example, the FacebookUserType_address will be >>> FacebookUserType.address. >>>> Best, >>>> Young-Seok >>>> >>>> On Wed, Jun 24, 2015 at 6:31 AM, Mike Carey wrote: >>>> >>>>> Much cleaner! Others should weigh in here to help finalize the >>>>> conventions.... Thoughts? >>>>> On Jun 23, 2015 5:31 PM, "Ildar Absalyamov" >>> wrote: >>>>>> So the general solution is that the generated names should become >>> less >>>>>> verbose (consider previous examples): >>>>>> 1) Anonymous fields naming scheme will change to outerTypeName + >> “_” >>> + >>>>>> fieldName, i.e. “Field_address_in_FacebookUserType” is changed to >>>>>> “FacebookUserType_address” >>>>>> 2) Anonymous collection item naming scheme stays the same, i.e. >>>>>> “Field_employment_in_FacebookUserType_ItemType” is changed to >>>>>> “FacebookUserType_employment_ItemType” (name is changed because the >>>>>> anonymous field employment naming was changed as described earlier) >>>>>> 3) Union type completely seizes to exist in metadata (it stays in >> the >>>>>> object model though), i.e. >>>>>> >> “Type_#1_UnionType_Field_end-date_in_Field_employment_in_FacebookUserType_ItemType” >>>>>> is changed to “FacebookUserType_employment_ItemType_end-date”, >> where >>>> the >>>>>> type metadata will have an additional field “Optional” with value >>>> “true”. >>>>>>> On Jun 19, 2015, at 18:11, Ildar Absalyamov >>>> wrote: >>>>>>> So I have done half of the fix, which is moved name generation >>> logic >>>>> out >>>>>> of the Metadata node to the client. >>>>>>> Up to that point nothing in Metadata format was changed, which >>> makes >>>> me >>>>>> wonder whether I should proceed with the following changes. >>>>>>> As it could be seen from the previous email getting rid of >>>>>> union-inferred name generation would make auto generated type names >>>> less >>>>>> scary, but not entirely. >>>>>>> Having in mind what Mike mentioned earlier today, should we do >>>>> something >>>>>> about other auto generated type name cases? >>>>>>>> On Jun 19, 2015, at 13:01, Ildar Absalyamov < >> iabsa001@cs.ucr.edu >>>>>> > wrote: >>>>>>>> Currently we are generating the names for inner\anonymous types >> in >>>> the >>>>>> following cases: >>>>>>>> 1) Anonymous field in the record. >>>>>>>> AQL Example: >>>>>>>> create type FacebookUserType as closed { >>>>>>>> id: int32, >>>>>>>> name: string, >>>>>>>> address: { >>>>>>>> address_line: string, >>>>>>>> city: string >>>>>>>> state: string >>>>>>>> } >>>>>>>> } >>>>>>>> The pattern for generating an anonymous field name is "Field_" + >>>>>> fieldName + "_in_" + outerTypeName, which translates to >>>>>> "Field_address_in_FacebookUserType" in the given example >>>>>>>> 2) Anonymous collection (ordered\unordered list) item >>>>>>>> create type FacebookUserType as closed { >>>>>>>> id: int32, >>>>>>>> name: string, >>>>>>>> employment: [{ >>>>>>>> organization-name: string, >>>>>>>> start-date: date >>>>>>>> end-date: date? >>>>>>>> }] >>>>>>>> } >>>>>>>> The pattern for generating an anonymous collection item name is >>>>>> collectionFieldName+_ItemType", which translates to >>>>>> "Field_employment_in_FacebookUserType_ItemType" in the given >> example >>>>>>>> 3) Nullable fields >>>>>>>> Same example as above could be used (end-date field): the >> pattern >>>> for >>>>>> generating a nullable field name is "Type_#" + >>> fieldsNumberInUnoinList >>>> + >>>>>> "_UnionType_" + outerTypeName, which translates to >>>>>> >> “Type_#1_UnionType_Field_end-date_in_Field_employment_in_FacebookUserType_ItemType" >>>>>> in the given example. >>>>>>>> So you can see these auto generated names could stack up pretty >>> fast >>>>>> and be completely incomprehensible. Just to give you a small flavor >>> of >>>>>> that, here is one of the metadata datasets type definitions: >>>>>>>> open { >>>>>>>> DataverseName: STRING, >>>>>>>> DatatypeName: STRING, >>>>>>>> Derived: UNION(NULL, open { >>>>>>>> Tag: STRING, >>>>>>>> IsAnonymous: BOOLEAN, >>>>>>>> EnumValues: UNION(NULL, [ STRING ]), >>>>>>>> Record: UNION(NULL, open { >>>>>>>> IsOpen: BOOLEAN, >>>>>>>> Fields: [ open { >>>>>>>> FieldName: STRING, >>>>>>>> FieldType: STRING >>>>>>>> } >>>>>>>> ] >>>>>>>> } >>>>>>>> ), >>>>>>>> Union: UNION(NULL, [ STRING ]), >>>>>>>> UnorderedList: UNION(NULL, STRING), >>>>>>>> OrderedList: UNION(NULL, STRING) >>>>>>>> } >>>>>>>> ), >>>>>>>> Timestamp: STRING >>>>>>>> } >>>>>>>> >>>>>>>> And here are couple of fields names, generated for it :) >>>>>>>> >> Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType >> Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType >> Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType >>>>>>>> Best regards, >>>>>>>> Ildar >>>>>>>> >>>>>>> Best regards, >>>>>>> Ildar >>>>>>> >>>>>> Best regards, >>>>>> Ildar >>>>>> >>>>>> --------------050803080605050806030302--