Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
dgraph
Commits
8cfabdf6
Commit
8cfabdf6
authored
9 years ago
by
Pawan Rawal
Browse files
Options
Downloads
Patches
Plain Diff
Storing string in value instead of byte slice for now
parent
3ee87845
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
query/graph/graphresponse.pb.go
+19
-19
19 additions, 19 deletions
query/graph/graphresponse.pb.go
query/graph/graphresponse.proto
+1
-1
1 addition, 1 deletion
query/graph/graphresponse.proto
query/query.go
+2
-2
2 additions, 2 deletions
query/query.go
query/query_test.go
+4
-4
4 additions, 4 deletions
query/query_test.go
with
26 additions
and
26 deletions
query/graph/graphresponse.pb.go
+
19
−
19
View file @
8cfabdf6
...
@@ -43,7 +43,7 @@ func (*Request) ProtoMessage() {}
...
@@ -43,7 +43,7 @@ func (*Request) ProtoMessage() {}
func
(
*
Request
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor0
,
[]
int
{
0
}
}
func
(
*
Request
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor0
,
[]
int
{
0
}
}
type
Value
struct
{
type
Value
struct
{
Binary
[]
byte
`protobuf:"bytes,1,opt,name=
binary,proto3
" json:"
binary
,omitempty"`
Str
string
`protobuf:"bytes,1,opt,name=
str
" json:"
str
,omitempty"`
}
}
func
(
m
*
Value
)
Reset
()
{
*
m
=
Value
{}
}
func
(
m
*
Value
)
Reset
()
{
*
m
=
Value
{}
}
...
@@ -156,22 +156,22 @@ var _DGraph_serviceDesc = grpc.ServiceDesc{
...
@@ -156,22 +156,22 @@ var _DGraph_serviceDesc = grpc.ServiceDesc{
}
}
var
fileDescriptor0
=
[]
byte
{
var
fileDescriptor0
=
[]
byte
{
// 2
72
bytes of a gzipped FileDescriptorProto
// 2
68
bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x09
,
0x6e
,
0x88
,
0x02
,
0xff
,
0x5c
,
0x
5
0
,
0x
c
1
,
0x4
a
,
0x
c
3
,
0x40
,
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x09
,
0x6e
,
0x88
,
0x02
,
0xff
,
0x5c
,
0x
9
0
,
0x
4
1
,
0x4
f
,
0x
8
3
,
0x40
,
0x10
,
0x
3
5
,
0x
4d
,
0x
36
,
0xd
a
,
0x
49
,
0x
51
,
0x
19
,
0x
45
,
0x
42
,
0x
15
,
0x
2c
,
0x
39
,
0x
68
,
0x4
f
,
0x
41
,
0x10
,
0x
8
5
,
0x
a5
,
0x
b0
,
0xd
5
,
0x
0e
,
0x
46
,
0x
cd
,
0x
ea
,
0x
01
,
0x
ab
,
0x
89
,
0x
cd
,
0x
1e
,
0x
b
4
,
0x
27
,
0x
e
2
,
0x
45
,
0xf4
,
0xaa
,
0x
78
,
0x
1
0
,
0x
44
,
0x
f
7
,
0x
e
0
,
0x
3
d
,
0x
31
,
0x
83
,
0x5d
,
0x2c
,
0x
49
,
0x
dc
,
0x
6
2
,
0x
f0
,
0x62
,
0xf4
,
0xaa
,
0x
f1
,
0x
6
0
,
0x
62
,
0x7
4
,
0x0
f
,
0xd
e
,
0x
a9
,
0x
4c
,
0x2c
,
0x
b1
,
0x
01
,
0x
6
c
,
0x
c4
,
0x
7e
,
0xbb
,
0x
17
,
0x
b3
,
0x
d3
,
0x
b5
,
0x06
,
0x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
a
f
,
0x
9b
,
0x
ed
,
0x
1a
,
0x
9
d
,
0x
0e
,
0x
63
,
0xa
8
,
0x
a
d
,
0x
c5
,
0x
98
,
0x
9b
,
0xb
f
,
0x
fa
,
0x
0d
,
0x
fd
,
0x5f
,
0xfe
,
0x04
,
0x00
,
0x00
,
0xff
,
0xff
,
0x
b8
,
0x
91
,
0x
31
,
0x
0d
,
0x9
6
,
0x01
,
0x00
,
0x00
,
0x
00
,
0x00
,
0xff
,
0xff
,
0x
e1
,
0x
8a
,
0x
e7
,
0x
89
,
0x9
0
,
0x01
,
0x00
,
0x00
,
}
}
This diff is collapsed.
Click to expand it.
query/graph/graphresponse.proto
+
1
−
1
View file @
8cfabdf6
...
@@ -13,7 +13,7 @@ message Request {
...
@@ -13,7 +13,7 @@ message Request {
}
}
message
Value
{
message
Value
{
bytes
binary
=
1
;
string
str
=
1
;
}
}
message
Node
{
message
Node
{
...
...
This diff is collapsed.
Click to expand it.
query/query.go
+
2
−
2
View file @
8cfabdf6
...
@@ -332,12 +332,12 @@ func (g *SubGraph) preTraverse(uid uint64, dst *graph.Node) error {
...
@@ -332,12 +332,12 @@ func (g *SubGraph) preTraverse(uid uint64, dst *graph.Node) error {
ival
=
""
ival
=
""
}
}
v
.
Binary
=
[]
byte
(
ival
.
(
string
)
)
v
.
Str
=
ival
.
(
string
)
properties
[
pc
.
Attr
]
=
v
properties
[
pc
.
Attr
]
=
v
}
}
}
}
if
val
,
ok
:=
properties
[
"_xid_"
];
ok
{
if
val
,
ok
:=
properties
[
"_xid_"
];
ok
{
dst
.
Xid
=
string
(
val
.
Binary
)
dst
.
Xid
=
val
.
Str
delete
(
properties
,
"_xid_"
)
delete
(
properties
,
"_xid_"
)
}
}
dst
.
Properties
,
dst
.
Children
=
properties
,
children
dst
.
Properties
,
dst
.
Children
=
properties
,
children
...
...
This diff is collapsed.
Click to expand it.
query/query_test.go
+
4
−
4
View file @
8cfabdf6
...
@@ -378,9 +378,9 @@ func TestToProtocolBuffer(t *testing.T) {
...
@@ -378,9 +378,9 @@ func TestToProtocolBuffer(t *testing.T) {
t
.
Errorf
(
"Expected values map to contain 3 properties, Got: %v"
,
t
.
Errorf
(
"Expected values map to contain 3 properties, Got: %v"
,
len
(
gr
.
Properties
))
len
(
gr
.
Properties
))
}
}
if
string
(
gr
.
Properties
[
"name"
]
.
Binary
)
!=
"Michonne"
{
if
string
(
gr
.
Properties
[
"name"
]
.
Str
)
!=
"Michonne"
{
t
.
Errorf
(
"Expected property name to have value Michonne, Got: %v"
,
t
.
Errorf
(
"Expected property name to have value Michonne, Got: %v"
,
string
(
gr
.
Properties
[
"name"
]
.
Binary
))
string
(
gr
.
Properties
[
"name"
]
.
Str
))
}
}
if
len
(
gr
.
Children
)
!=
10
{
if
len
(
gr
.
Children
)
!=
10
{
t
.
Errorf
(
"Expected 10 children, Got: %v"
,
len
(
gr
.
Children
))
t
.
Errorf
(
"Expected 10 children, Got: %v"
,
len
(
gr
.
Children
))
...
@@ -397,9 +397,9 @@ func TestToProtocolBuffer(t *testing.T) {
...
@@ -397,9 +397,9 @@ func TestToProtocolBuffer(t *testing.T) {
t
.
Errorf
(
"Expected values map to contain 1 property, Got: %v"
,
t
.
Errorf
(
"Expected values map to contain 1 property, Got: %v"
,
len
(
child
.
Properties
))
len
(
child
.
Properties
))
}
}
if
string
(
child
.
Properties
[
"name"
]
.
Binary
)
!=
"Rick Grimes"
{
if
string
(
child
.
Properties
[
"name"
]
.
Str
)
!=
"Rick Grimes"
{
t
.
Errorf
(
"Expected property name to have value Rick Grimes, Got: %v"
,
t
.
Errorf
(
"Expected property name to have value Rick Grimes, Got: %v"
,
string
(
child
.
Properties
[
"name"
]
.
Binary
))
string
(
child
.
Properties
[
"name"
]
.
Str
))
}
}
if
len
(
child
.
Children
)
!=
0
{
if
len
(
child
.
Children
)
!=
0
{
t
.
Errorf
(
"Expected 0 children, Got: %v"
,
len
(
child
.
Children
))
t
.
Errorf
(
"Expected 0 children, Got: %v"
,
len
(
child
.
Children
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment