Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support enum types in GoFS #75

Closed
simmhan opened this issue Jul 14, 2013 · 8 comments
Closed

Support enum types in GoFS #75

simmhan opened this issue Jul 14, 2013 · 8 comments
Assignees
Labels
Milestone

Comments

@simmhan
Copy link
Member

simmhan commented Jul 14, 2013

Trivially support enum types by mapping them to byte type. E.g. for twitter data, there are several different edge types. Usng strings is costly and using ints/bytes is opaque. Can we add some semantic sugar?

@ghost ghost assigned sooniln Jul 14, 2013
@sooniln
Copy link

sooniln commented Jul 14, 2013

I'm not entirely sure what we need here, do you have an example?

@simmhan
Copy link
Member Author

simmhan commented Jul 14, 2013

Yes. E.g. we’re looking at a twitter graph where the edges can have the values “mentions, retweets, wasMentioned, wasRetweeted”. While the GML/Slices could store these four values as strings, it may be costly in terms of I/O storage/access/parsing. Instead, if we could have the template GML define their type as:

type: “enum: mentions(0), retweets(1), wasMentioned(2), wasRetweeted(3)”

Then the slices could store the int values rather than the string values, with the template holding the mapping. In the graph API, we could provide a resolver that gets the property value either as int or string.

--Yogesh


Yogesh Simmhan | mailto:simmhan@usc.edu simmhan@usc.edu | http://ceng.usc.edu/~simmhan ceng.usc.edu/~simmhan | skype skype:simmhan simmhan | cel tel:+15404494770 +1 (540) 449 4770

From: Soonil Nagarkar [mailto:notifications@github.com]
Sent: Sunday, July 14, 2013 1:14 PM
To: usc-cloud/goffish
Cc: Yogesh Simmhan
Subject: Re: [goffish] Support enum types in GoFS (#75)

I'm not entirely sure what we need here, do you have an example?


Reply to this email directly or view it on GitHub #75 (comment) .

@sooniln
Copy link

sooniln commented Jul 14, 2013

Why don't we leave this up to the client to implement? This is 5-10 lines of code to add on the client side, but a decent amount of work to implement properly in GoFS, as well as being a hacky extension to GML.

@simmhan
Copy link
Member Author

simmhan commented Jul 14, 2013

That’s fine. Low priority if it is non-trivial. Support for Booleans fall in this space too. Retain this issue but push it for 2.x milestone when we can revisit and close/implement it.


Yogesh Simmhan | mailto:simmhan@usc.edu simmhan@usc.edu | http://ceng.usc.edu/~simmhan ceng.usc.edu/~simmhan | skype skype:simmhan simmhan | cel tel:+15404494770 +1 (540) 449 4770

From: Soonil Nagarkar [mailto:notifications@github.com]
Sent: Sunday, July 14, 2013 1:26 PM
To: usc-cloud/goffish
Cc: Yogesh Simmhan
Subject: Re: [goffish] Support enum types in GoFS (#75)

Why don't we leave this up to the client to implement? This is 5-10 lines of code to add on the client side, but a decent amount of work to implement properly in GoFS, as well as being a hacky extension to GML.


Reply to this email directly or view it on GitHub #75 (comment) .

@sooniln
Copy link

sooniln commented Jul 14, 2013

we support booleans, ints, longs, floats, doubles and strings at the moment.

@simmhan
Copy link
Member Author

simmhan commented Jul 14, 2013

Oh, it thought we only supported int, double and string.

I’ll update the documentation I just checked in.

So the vertex ID properties are int and edge ID properties are long?


Yogesh Simmhan | mailto:simmhan@usc.edu simmhan@usc.edu | http://ceng.usc.edu/~simmhan ceng.usc.edu/~simmhan | skype skype:simmhan simmhan | cel tel:+15404494770 +1 (540) 449 4770

From: Soonil Nagarkar [mailto:notifications@github.com]
Sent: Sunday, July 14, 2013 1:31 PM
To: usc-cloud/goffish
Cc: Yogesh Simmhan
Subject: Re: [goffish] Support enum types in GoFS (#75)

we support booleans, ints, longs, floats, doubles and strings at the moment.


Reply to this email directly or view it on GitHub #75 (comment) .

@sooniln
Copy link

sooniln commented Jul 14, 2013

GML itself only supports long, double and string. however GoFS properties are allowed to be int, long, float, double, and string, so we map the GML types to GoFS types as specified in the wiki page on GML. vertex id and edge id are not 'properties' per se, so they don't undergo the same conversion, but they are both longs.

@simmhan
Copy link
Member Author

simmhan commented Jul 14, 2013

Ok. I’m documenting the JSON format (which Santosh is translating to GML). I’ll retain the full set of supported types since this is meant for external use. We can continue to do our internal mapping within GML.


Yogesh Simmhan | mailto:simmhan@usc.edu simmhan@usc.edu | http://ceng.usc.edu/~simmhan ceng.usc.edu/~simmhan | skype skype:simmhan simmhan | cel tel:+15404494770 +1 (540) 449 4770

From: Soonil Nagarkar [mailto:notifications@github.com]
Sent: Sunday, July 14, 2013 1:36 PM
To: usc-cloud/goffish
Cc: Yogesh Simmhan
Subject: Re: [goffish] Support enum types in GoFS (#75)

GML itself only supports long, double and string. however GoFS properties are allowed to be int, long, float, double, and string, so we map the GML types to GoFS types as specified in the wiki page on GML. vertex id and edge id are not 'properties' per se, so they don't undergo the same conversion, but they are both longs.


Reply to this email directly or view it on GitHub #75 (comment) .

@sooniln sooniln closed this as completed Jul 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants