-
Notifications
You must be signed in to change notification settings - Fork 71
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 scan Nebula subgraph results (vertex and edge) and slice of struct ptr #346
Conversation
need to add some tests |
ok, at least I didn't break anything 😂 |
8d1cfc0
to
ed2ca89
Compare
222d26e
to
62da147
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #346 +/- ##
==========================================
+ Coverage 64.36% 64.41% +0.05%
==========================================
Files 11 11
Lines 2963 3041 +78
==========================================
+ Hits 1907 1959 +52
- Misses 897 915 +18
- Partials 159 167 +8 ☔ View full report in Codecov by Sentry. |
33f24f7
to
686edf3
Compare
@haoxins is this still in draft state or? |
draft, I need to add some basic tests later |
686f421
to
b6d665c
Compare
hello, is it possible to finish this before the Oct holiday? 😂 |
37b69ad
to
0985fcf
Compare
The failed test seems not relevant to this PR's changes |
@HarrisChu @Nicole00 can we move this further in this week? |
0985fcf
to
1b17931
Compare
@Nicole00 can we move forward? not sure the failed UTs reasons |
|
||
func scanPrimitiveCol(rowVal *nebula.Value, val reflect.Value, kind reflect.Kind) error { | ||
switch kind { | ||
case reflect.Bool: |
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.
when rowVal is Null type, how to set value for reflect.Value?
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.
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.
should we just skip to set the value if empty or null? I mean
func scanPrimitiveCol(rowVal *nebula.Value, val reflect.Value, kind reflect.Kind) error {
if rowVal.IsSetNVal() {
return nil
}
...
}
But, is there a easy way to do IsEmpty
on the type *nebula.Value
?
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.
May I move the method
GetType
fromValueWrapper
to*Value
?
emm, we can't move the method GetType
into *nebula.Value
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.
BTW, what is the situation will output empty
or null
? I running these codes in my server for months already.
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.
you means
func scanPrimitiveCol(rowVal *nebula.Value, val reflect.Value, kind reflect.Kind) error {
w := ValueWrapper{value: rowVal}
if w.IsNull() || w.IsEmpty() {
val.SetZero()
return 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.
Emm, will cause a bit performance cost but not a problem.
And, a bit ugly 😂
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.
ok, tests passed
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.
Sorry it's too slow to review it and too late to reply.
Please forgive me for not understanding why it is ugly~ I think that is the logic that must be processed, otherwise this method will not be able to handle null values.
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.
Please forgive me for not understanding why it is ugly~
Never mind, I found I don't need to copy the logic of IsNull
and IsEmpty
finally.
Just need to use ValueWrapper
.
@Nicole00 may you please give this another, possibly, last check? |
May we get this merged? |
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Description:
How do you solve it?
Special notes for your reviewer, ex. impact of this fix, design document, etc: