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 A783117524 for ; Wed, 24 Jun 2015 22:17:03 +0000 (UTC) Received: (qmail 94598 invoked by uid 500); 24 Jun 2015 22:17:03 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 94549 invoked by uid 500); 24 Jun 2015 22:17:03 -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 94533 invoked by uid 99); 24 Jun 2015 22:17:03 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jun 2015 22:17:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CD7A518195D for ; Wed, 24 Jun 2015 22:17:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.99 X-Spam-Level: ** X-Spam-Status: No, score=2.99 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id e67KGypbw8xj for ; Wed, 24 Jun 2015 22:16:54 +0000 (UTC) Received: from mx1.ucr.edu (mx1.ucr.edu [138.23.248.2]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 5005E43E2F for ; Wed, 24 Jun 2015 22:16:53 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DhAQCyK4tVlC9SfUpbgkWBfwaDGKdKBpIqh14CgUUHORMBAQEBAQEBEQEBAQEHCwsJHzCEIgEBAQMBEhFbCwkCCwUIIAcDAgIhARIBBQELERkbB4d4AwoIBZockGs+MYs/kEENRwGFSwqGEoQsgQKCTYFWEQFYgmiBQwWME26HAgKJcIFhgTqPZYM9ghESI4EWF4IbHIFyHjGBDIE8AQEB X-IPAS-Result: A2DhAQCyK4tVlC9SfUpbgkWBfwaDGKdKBpIqh14CgUUHORMBAQEBAQEBEQEBAQEHCwsJHzCEIgEBAQMBEhFbCwkCCwUIIAcDAgIhARIBBQELERkbB4d4AwoIBZockGs+MYs/kEENRwGFSwqGEoQsgQKCTYFWEQFYgmiBQwWME26HAgKJcIFhgTqPZYM9ghESI4EWF4IbHIFyHjGBDIE8AQEB X-IronPort-AV: E=Sophos;i="5.13,673,1427785200"; d="scan'208";a="408175810" Received: from mail-wg0-f47.google.com ([74.125.82.47]) by smtp1.ucr.edu with ESMTP/TLS/RC4-SHA; 24 Jun 2015 15:16:50 -0700 Received: by wgbhy7 with SMTP id hy7so47511289wgb.2 for ; Wed, 24 Jun 2015 15:16:49 -0700 (PDT) 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=V5K3toYoAObORWA9Fvxbd2eZ0geIK2BZbno0M2Y0aYg=; b=h7SfFMZ0EQ4LdZYMJFLwMr435ziandZEnP9RI27fiCmqDwZrRAKc5hEe+KcQ0+zGaG JR9n6zuOjA26kJEnRqghay2axQPDZEJtylDve77nYXvpVCc6d5SrM681K1XkSksBwaQQ TOJWT6Ct93eWD4id+f/dLe84ueSxzsIF5Qkvz1xftwTmPmSRGogqOjszufxNV5Wxw8gP VaTlpZBdKcrPbFS52Y9TXfLlaVQ/MmEs+WQ17lF1eZ89NSqCgRGR+V+3hLW5cpHt+CoC 3GHoIKTxEnmVpdGhWsdlfkPLdUpcBBPQEJGmz88dxp763Mgtj6im4GZn7Y1WOX0NOnAz NTkw== X-Gm-Message-State: ALoCoQnAEIhZyuCQRtPgqUhSv68WzmQ4EEJjt3zR5A3DL3GDuj/hRSewXNgWToJyHtZrEckig8UU+010VucmkORnil44ktLySD9IZEPRt3Q3sYDQYUmomGD+s/MTAt+Xwlv3MiqglKQRfhA7xjF3Qb6wSJX2wVYgIg== X-Received: by 10.180.107.138 with SMTP id hc10mr97045wib.2.1435184209581; Wed, 24 Jun 2015 15:16:49 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.107.138 with SMTP id hc10mr97024wib.2.1435184209413; Wed, 24 Jun 2015 15:16:49 -0700 (PDT) Received: by 10.28.173.8 with HTTP; Wed, 24 Jun 2015 15:16:49 -0700 (PDT) In-Reply-To: References: <308FDBD8-616C-4649-8824-C150B794D5F6@cs.ucr.edu> <56C5E538-F605-4AC3-B3AB-C05686B8DF44@cs.ucr.edu> Date: Wed, 24 Jun 2015 15:16:49 -0700 Message-ID: Subject: Re: Metadata names generation From: Steven Jacobs To: dev@asterixdb.incubator.apache.org Content-Type: multipart/alternative; boundary=e89a8f235739fd58b505194adc82 --e89a8f235739fd58b505194adc82 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable a clear case is where there is a data type with a field named "a.b" and another field named "a" which has a nested field named "b". This is allowed right now. You would have to access the first as "a.b" and the second as a.b. The quotes basically tell the parser "this is a single name with whatever characters I want in it." To me it seems fine to disallow some characters, but back when I had discussions about this with Vinayak, Mike, and Till, Till was arguing against disallowing characters. I can't really remember his reasons now though. @Till, what are your thoughts on this? Steven On Wed, Jun 24, 2015 at 11:56 AM, abdullah alamoudi wrote: > If that's the case, then I think we need to disallow using the "." since = it > is used to access nested fields and can definitely cause ambiguity. > > a clear case is where there is a data type with a field named "a.b" and > another field named "a" which has a nested field named "b". > > Thoughts? > > > On Wed, Jun 24, 2015 at 9:51 PM, Steven Jacobs wrote: > > > I think there is no completely user-friendly way around this. Basically > our > > names allow ALL characters if they are incapsulated in quotes, so there > > isn't a character we can use that doesn't have the potential for > ambiguity > > from the user's perspective. This is why I had to change the nested stu= ff > > in indexing to be a list of strings rather than a single string. > > Steven > > > > On Wed, Jun 24, 2015 at 11:43 AM, Chen Li wrote: > > > > > In this case, there could be ambiguity in the names. Does it matter? > > > > > > Chen > > > > > > On Wed, Jun 24, 2015 at 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 name= s > > > 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 < > > kisskys@gmail.com> > > > > > > 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" < > > iabsa001@cs.ucr.edu > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > So the general solution is that the generated names shoul= d > > > become > > > > > > less > > > > > > > > > verbose (consider previous examples): > > > > > > > > > 1) Anonymous fields naming scheme will change to > > outerTypeName > > > + > > > > > =E2=80=9C_=E2=80=9D > > > > > > + > > > > > > > > > fieldName, i.e. =E2=80=9CField_address_in_FacebookUserTyp= e=E2=80=9D is > > changed > > > to > > > > > > > > > =E2=80=9CFacebookUserType_address=E2=80=9D > > > > > > > > > 2) Anonymous collection item naming scheme stays the same= , > > i.e. > > > > > > > > > =E2=80=9CField_employment_in_FacebookUserType_ItemType=E2= =80=9D is changed > to > > > > > > > > > =E2=80=9CFacebookUserType_employment_ItemType=E2=80=9D (n= ame is changed > > because > > > > the > > > > > > > > > anonymous field employment naming was changed as describe= d > > > > earlier) > > > > > > > > > 3) Union type completely seizes to exist in metadata (it > > stays > > > in > > > > > the > > > > > > > > > object model though), i.e. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =E2=80=9CType_#1_UnionType_Field_end-date_in_Field_employment_in_Facebook= UserType_ItemType=E2=80=9D > > > > > > > > > is changed to > > =E2=80=9CFacebookUserType_employment_ItemType_end-date=E2=80=9D, > > > > > where > > > > > > > the > > > > > > > > > type metadata will have an additional field =E2=80=9COpti= onal=E2=80=9D with > > > value > > > > > > > =E2=80=9Ctrue=E2=80=9D. > > > > > > > > > > > > > > > > > > > On Jun 19, 2015, at 18:11, Ildar Absalyamov < > > > > iabsa001@cs.ucr.edu > > > > > > > > > > > > > > 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 change= s. > > > > > > > > > > > > > > > > > > > > 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, shoul= d > 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 ite= m > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > =E2=80=9CType_#1_UnionType_Field_end-date_in_Field_employment_in_Facebook= UserType_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_Data= typeRecordType > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordT= ype > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > Amoudi, Abdullah. > --e89a8f235739fd58b505194adc82--