Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 06B6F200CB8 for ; Fri, 16 Jun 2017 10:58:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 057AF160BDD; Fri, 16 Jun 2017 08:58:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 23DC3160BD2 for ; Fri, 16 Jun 2017 10:58:05 +0200 (CEST) Received: (qmail 68578 invoked by uid 500); 16 Jun 2017 08:58:05 -0000 Mailing-List: contact dev-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list dev@atlas.incubator.apache.org Received: (qmail 68555 invoked by uid 99); 16 Jun 2017 08:58:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2017 08:58:05 +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 D91E0188AA8 for ; Fri, 16 Jun 2017 08:58:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id MrxsuPwSBgkW for ; Fri, 16 Jun 2017 08:58:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 53EF85FBBF for ; Fri, 16 Jun 2017 08:58:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 281A6E0D57 for ; Fri, 16 Jun 2017 08:58:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 478F22400B for ; Fri, 16 Jun 2017 08:58:00 +0000 (UTC) Date: Fri, 16 Jun 2017 08:58:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@atlas.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ATLAS-1875) Gremlin id is no longer returned for vertices in gremlin query MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 16 Jun 2017 08:58:07 -0000 [ https://issues.apache.org/jira/browse/ATLAS-1875?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1605= 1623#comment-16051623 ]=20 ASF GitHub Bot commented on ATLAS-1875: --------------------------------------- GitHub user cmar81 opened a pull request: https://github.com/apache/incubator-atlas/pull/36 [ATLAS-1875] Adding the gremlin id for a vertex back into the search = =E2=80=A6 =E2=80=A6result for a gremlin search. This functionality was present in= Atlas 0.7 but disappeared when an abstraction layer was introduced You can merge this pull request into a Git repository by running: $ git pull https://github.com/cmar81/incubator-atlas master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-atlas/pull/36.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #36 =20 ---- commit 485775868dae4afb1a27fe9f0c2c5bb4074a0d93 Author: Christian Rieck Date: 2017-06-16T08:45:22Z [ATLAS-1875] Adding the gremlin id for a vertex back into the search re= sult for a gremlin search. This functionality was present in Atlas 0.7 but = disappeared when an abstraction layer was introduced ---- > Gremlin id is no longer returned for vertices in gremlin query > -------------------------------------------------------------- > > Key: ATLAS-1875 > URL: https://issues.apache.org/jira/browse/ATLAS-1875 > Project: Atlas > Issue Type: Bug > Components: atlas-core > Affects Versions: trunk, 0.8-incubating > Reporter: Christian R > Labels: dsl, gremlin > > Hi,=20 > while investigating a move from atlas 0.7 to 0.8 (HDP 2.5 to HDP2.6) our = tests fail on gremlin queries. It turns out that the returned entities in a= gremlin search in 0.8 does not include the 'id' attribute.=20 > I've built commit a0bd93945cd45457bbf34a8cb819d4fa4ba72964 (0.8-rc1) on l= inux using berkely and elasticearch to test with.=20 > The query=20 > :21000/api/atlas/discovery/search/gremlin?g.V.has('__type.name', 'Infrast= ructure').collect() > on our 0.7 cluster gives > {code:json} > { > __type.name: "Infrastructure", > __type.category: "CLASS", > __type: "typeSystem", > id: "16640" > }{code} > while the same query on my 0.8-rc1 installation gives=20 > {code:javascript} > { > __type.name: "Infrastructure", > __version: "1", > __type.category: "CLASS", > __type.version: "1.0", > __modificationTimestamp: "1497448424134", > __type: "typeSystem", > __type.options: "null", > __type.description: "Infrastructure", > __guid: "77d07283-7622-4305-9c0c-09ac5aee86c8", > __timestamp: "1497448424134" > } > {code} > Certainly more information, but id is missing.=20 > The very poor DSL performance (see ATLAS-1868) and a need for advanced q= ueries led us to base our queries on gremlin. This has worked very well so = far. We include both edges and nodes in the result set and use the inVertex= , outVertex and label info on the edges to rebuild our tree on the client s= ide. > I also see that gremlin has disappeared from version two of the API. Sinc= e addE and addV lets you insert into the graph I can see how exposing a ful= l gremlin endpoint might not be wanted.=20 > As an example of the queries we run that I haven't been able to express i= n the DSL is=20 > {noformat} > query =3D g.V.has('__guid','xxxx').copySplit( > =09=09=09=09_().out('track'),=20 > =09=09=09=09_().as('x') > =09=09=09=09.out('functions', 'component') > =09=09=09=09.loop('x'){true}{true} > =09=09=09=09=09.copySplit( > =09=09=09=09=09=09_(), > =09=09=09=09=09=09_().in('part_of'), > =09=09=09=09=09=09_().outE('functions', 'component'), > =09=09=09=09=09=09_().inE('part_of') > =09=09=09=09=09) > =09=09=09=09.exhaustMerge.dedup > =09=09=09) > =09=09=09.exhaustMerge > .collect() > {noformat} > this might not be a normal usecase.=20 > edit to add:=20 > I looked at GraphBackedDiscoveryService.java and notice that: > 0.7: > {code:java} > else if (r instanceof TitanVertex) { > Iterable ps =3D ((TitanVertex) r).getPrope= rties(); > for (TitanProperty tP : ps) { > String pName =3D tP.getPropertyKey().getName(); > Object pValue =3D ((TitanVertex) r).getProperty(pName= ); > if (pValue !=3D null) { > oRow.put(pName, pValue.toString()); > } > } > {code} > Vs 0.8 code:=20 > {code:java} > else if (value instanceof AtlasVertex) { > AtlasVertex vertex =3D (AtlasVertex)value; > for (String key : vertex.getPropertyKeys()) { > Object propertyValue =3D GraphHelper.getProperty(= vertex, key); > if (propertyValue !=3D null) { > oRow.put(key, propertyValue.toString()); > } > } > {code} > look very similar.=20 > However, 0.8 handles id in edges explicitly while the 0.7 doesn=E2=80=99t= treat edges explicitly at all. > {code:java} > else if(value instanceof AtlasEdge) { > AtlasEdge edge =3D (AtlasEdge) value; > oRow.put("id", edge.getId().toString()); > oRow.put("label", edge.getLabel()); > oRow.put("inVertex", edge.getInVertex().getId().toStr= ing()); > oRow.put("outVertex", edge.getOutVertex().getId().toS= tring()); > for (String propertyKey : edge.getPropertyKeys()) { > oRow.put(propertyKey, GraphHelper.getProperty(edg= e, propertyKey).toString()); > } > {code} > Should a=20 > oRow.put("id", vertex.getId().toString()); > be added to the vertex-case?=20 -- This message was sent by Atlassian JIRA (v6.4.14#64029)