Im using datastax graph. How can I transform the OLTP query to OLAP query ?

79 views
Skip to first unread message

Sara

unread,
Nov 17, 2016, 2:36:10 PM11/17/16
to Gremlin-users
,Hello


How can I transform the following OLTP query to OLAP query : 

(g.V(ids).repeat(timeLimit(2000).bothE().otherV().simplePath(‌​)).times(5).emit(has‌​Id(within(ids2)).whe‌​re(hasId(within(ids2‌​))).path() .limit(5

according to the following example :


Please help

Daniel Kuppitz

unread,
Nov 17, 2016, 5:58:57 PM11/17/16
to gremli...@googlegroups.com
It's usually as easy as using another traversal source (plus I would get rid of timeLimit()'s in OLAP:

a.V(ids).repeat(bothE().otherV().simplePath(‌​)).times(5).emit(has‌​Id(within(ids2)).whe‌​re(hasId(within(ids2‌​))).path().limit(5)

However, while trying it out, I noticed that we have a crazy bug in the 3.2+ line:


Hence the answer to your question is: that's currently not possible.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/31072839-1cb7-49ae-9744-e24e5a2d833a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sara

unread,
Nov 18, 2016, 1:18:06 AM11/18/16
to Gremlin-users
Hi daniel.thanks for your reply.

find path between vertexes is a very critical issue for all graph users.and not be able to query shortest path in OLAP mode is a big problem.how can we ask to fix this bug?.

Im using node.js driver for datastax.(and cassandra driver for node.js).

Is it possible query OLAP queries using node.js dayadtax driver?

Kevin Gallardo

unread,
Nov 21, 2016, 11:22:08 AM11/21/16
to Gremlin-users
Hi,

For information's sake, yes it is possible to start OLAP job with the DataStax Nodejs driver, you don't necessarily need to change the traversal source name in the traversal itself, only to set the source name to "a", in the appropriate execution profile. i.e. create the client with a profile like this:

const client = new Client({
  contactPoints
: ['host1'],
  profiles
: [
   
new ExecutionProfile('graph-olap', {
      readTimeout
: 0,
      graphOptions
:  { name: 'myGraph', source: 'a' }
   
})
 
]
});


Then use this particular profile when executing a query:

client.executeGraph('g.V().count()', params, { executionProfile: 'graph-olap'}, function (err, result) {
 
assert.ifError(err);
  console
.log(result);
});


Hope that helps.

Daniel Kuppitz

unread,
Nov 23, 2016, 8:36:12 AM11/23/16
to gremli...@googlegroups.com
The issue has been resolved and as it turned out, the bug never made it into an official release.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

Sara

unread,
Dec 6, 2016, 12:11:25 PM12/6/16
to Gremlin-users
Im using datastax 5.0.3 with tinkerpop 3.2.0

I run the following query in analytic mode in datastax studio 

a.V(ids).repeat(bothE().otherV().simplePath(‌​)).times(5).emit(has‌​Id(within(ids2)).whe‌​re(hasId(within(ids2‌​))).path().limit(5)

and I got error 


"repat is not supported" and path is not supported

בתאריך יום רביעי, 23 בנובמבר 2016 בשעה 15:36:12 UTC+2, מאת Daniel Kuppitz:
The issue has been resolved and as it turned out, the bug never made it into an official release.

Cheers,
Daniel

On Fri, Nov 18, 2016 at 7:18 AM, Sara <einav...@gmail.com> wrote:
Hi daniel.thanks for your reply.

find path between vertexes  is a very critical issue for all graph users.and not be able to  query shortest path in OLAP mode is a big problem.how can we ask to fix this bug?.

Im using node.js driver for datastax.(and cassandra driver for node.js).

Is it possible query OLAP queries using node.js dayadtax driver?

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Daniel Kuppitz

unread,
Dec 7, 2016, 10:44:25 AM12/7/16
to gremli...@googlegroups.com
The query works me. Which version are you using and what's the exact error message (+ stack trace if available)?

Cheers,
Daniel


To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/8b4cb1ef-848f-43c4-80fd-eb4822902bce%40googlegroups.com.

Sara

unread,
Dec 8, 2016, 3:51:27 PM12/8/16
to Gremlin-users
  Im using datastax 5.0.3 with tinkerpop 3.2.0.

The follwing query works for me
(person = graph.snapshot().vertices('person

()person.V().count

But 


([g.V(['~label':'FridgeSensor','city_id':100,'sensor_id':'60bcae02-f6e5-11e5-9ce9-5e5517507c66

works in OLTP but not in OLAP

Soon I will be able to give you the exact error , But how can it be? can it be datastax OLAP bug?

בתאריך יום חמישי, 17 בנובמבר 2016 בשעה 21:36:10 UTC+2, מאת Sara:

Sara

unread,
Dec 8, 2016, 3:59:40 PM12/8/16
to Gremlin-users
Hi Daniel'

According to tinkerpop3 documentation path does not work with OLAP mode

WARNING

Generating path information is expensive as the history of the traverser is stored into a Java list. With numerous traversers, there are numerous lists. Moreover, in an OLAP GraphComputer environment this becomes exceedingly prohibitive as there are traversers emanating from all vertices in the graph in parallel. In OLAP there are optimizations provided for traverser populations, but when paths are calculated (and each traverser is unique due to its history), then these optimizations are no longer possible.

This page from the latest tinkerpop3 version 3.2.4:

 

http://tinkerpop.apache.org/docs/3.2.4-SNAPSHOT/reference/

 


בתאריך יום חמישי, 17 בנובמבר 2016 בשעה 21:36:10 UTC+2, מאת Sara:
,Hello
Reply all
Reply to author
Forward
0 new messages