-
Notifications
You must be signed in to change notification settings - Fork 845
Go GLV replace Bytecode with GremlinLang & update serialization to GraphBinary 4 #3292
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
Conversation
| if math.IsNaN(float64(v)) { | ||
| return "NaN", nil | ||
| } | ||
| if math.IsInf(float64(v), 1) { | ||
| return "Infinity", nil | ||
| } | ||
| if math.IsInf(float64(v), -1) { | ||
| return "-Infinity", nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely out of scope for this PR, but its occurring to me that we are losing the float 32 type for infinities and NaNs. Seems like a minor gap in the grammar which we may want to address.
| case time.Time: | ||
| return fmt.Sprintf("datetime(\"%v\")", v.Format(time.RFC3339)), nil | ||
| case cardinality, column, direction, operator, order, pick, pop, barrier, scope, t, merge, gType: | ||
| name := reflect.ValueOf(v).Type().Name() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate that we need to use reflection here. Definitely out of scope for this PR but we might want to revisit the design of our "pseudo-enums" and see if there's anything better.
| return g.V("44").ValueMap().With(WithOptions.Tokens, WithOptions.Labels) | ||
| }, | ||
| equals: "g.V('44').valueMap().with(WithOptions.tokens,WithOptions.labels)", | ||
| equals: "g.V(\"44\").valueMap().with(\"~tinkerpop.valueMap.tokens\",2)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WithOptions in this and following cases don't look right, the grammar should parse the enums directly.
| equals: "g.V(\"44\").valueMap().with(\"~tinkerpop.valueMap.tokens\",2)", | |
| equals: "g.V(\"44\").valueMap().with(WithOptions.tokens,WithOptions.labels)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grammar actually accepts the string literal. It looks like python also sends this, so I'd think it's a separate topic for revisit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd much rather see WithOptions encoded in token form (WithOptions.tokens, WithOptions.labels) instead of their underlying value form ("~tinkerpop.valueMap.tokens", 2), however I see that this may present a challenge given the current implementation in some languages. I agree this should be saved for a future revisit.
| UnscaledValue *big.Int | ||
| } | ||
|
|
||
| func (bd *BigDecimal) Value() *big.Float { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could get rid of our BigDecimal type and allow users to directly use the native big.Float type
60a6887 to
9ba6ac2
Compare
|
VOTE +1 |
|
I still have a few unresolved comments here which I believe need to be addressed before the TP4 Go GLV can be considered complete, however I'm ok with considering all of these out of scope of this PR, and as topics to be revisited later. VOTE +1 |
|
This is a necessary change to make the Go driver compatible with TinkerPop 4 so my VOTE is +1. |
416570e to
3a32645
Compare
…o 4.0 spec. Contains various code updates & fixes to enable HTTP connection & tests.
3a32645 to
4430cee
Compare
A follow up of #3059 to make the go GLV working and buildable in master. Most implementations were done previously inside a feature branch, updates were needed due to accumulated tech debts in the past year.
Major changes included in this PR:
Additional changes includes test set-up fixes, HTTP connection updates, basic auth, and various update in traversal to enable successful build.
Major changes pending: