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 scan Nebula subgraph results (vertex and edge) and slice of struct ptr #346

Merged
merged 9 commits into from
Jan 17, 2025

Conversation

haoxins
Copy link
Collaborator

@haoxins haoxins commented Jun 26, 2024

What type of PR is this?

  • bug
  • feature
  • enhancement

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:

@haoxins
Copy link
Collaborator Author

haoxins commented Jun 26, 2024

need to add some tests

@haoxins
Copy link
Collaborator Author

haoxins commented Jun 26, 2024

ok, at least I didn't break anything 😂

@haoxins haoxins changed the title Support scan Nebula vertex and edge Support scan Nebula subgraph results (vertex and edge) Jun 26, 2024
@haoxins haoxins marked this pull request as draft June 27, 2024 06:01
@haoxins haoxins force-pushed the feat-nest-struct branch 5 times, most recently from 8d1cfc0 to ed2ca89 Compare June 29, 2024 12:49
@wey-gu wey-gu requested review from HarrisChu and Nicole00 June 29, 2024 15:07
@haoxins haoxins force-pushed the feat-nest-struct branch 2 times, most recently from 222d26e to 62da147 Compare June 29, 2024 16:56
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 63.10680% with 38 lines in your changes missing coverage. Please review.

Project coverage is 64.41%. Comparing base (4e4de32) to head (b6d665c).

Files with missing lines Patch % Lines
result_set.go 63.10% 30 Missing and 8 partials ⚠️

❗ 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.
📢 Have feedback on the report? Share it here.

@haoxins haoxins force-pushed the feat-nest-struct branch 14 times, most recently from 33f24f7 to 686edf3 Compare June 30, 2024 15:24
@wey-gu
Copy link
Contributor

wey-gu commented Jul 1, 2024

@haoxins is this still in draft state or?

@haoxins
Copy link
Collaborator Author

haoxins commented Jul 1, 2024

@haoxins is this still in draft state or?

draft, I need to add some basic tests later

wey-gu
wey-gu previously approved these changes Sep 21, 2024
@wey-gu
Copy link
Contributor

wey-gu commented Sep 21, 2024

@HarrisChu @Nicole00

@haoxins
Copy link
Collaborator Author

haoxins commented Sep 27, 2024

hello, is it possible to finish this before the Oct holiday? 😂

@haoxins haoxins changed the title Support scan Nebula subgraph results (vertex and edge) Support scan Nebula subgraph results (vertex and edge) and slice of struct ptr Nov 4, 2024
@haoxins
Copy link
Collaborator Author

haoxins commented Nov 4, 2024

The failed test seems not relevant to this PR's changes
https://github.com/vesoft-inc/nebula-go/actions/runs/11659550672/job/32460307401?pr=346#step:4:620

@wey-gu
Copy link
Contributor

wey-gu commented Nov 4, 2024

@HarrisChu @Nicole00 can we move this further in this week?

@haoxins
Copy link
Collaborator Author

haoxins commented Dec 3, 2024

@HarrisChu @Nicole00 can we move this further in this week?

@Nicole00 can we move forward? not sure the failed UTs reasons

@haoxins
Copy link
Collaborator Author

haoxins commented Dec 23, 2024

hi, as discussed in #361
can we move forward? cc @wey-gu @Nicole00


func scanPrimitiveCol(rowVal *nebula.Value, val reflect.Value, kind reflect.Kind) error {
switch kind {
case reflect.Bool:
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to process these two types.
image

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

@haoxins haoxins Dec 23, 2024

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 from ValueWrapper to *Value?

emm, we can't move the method GetType into *nebula.Value

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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
    }

    ......
}

Copy link
Collaborator Author

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 😂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, tests passed

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@Kiro369
Copy link

Kiro369 commented Dec 28, 2024

@Nicole00 may you please give this another, possibly, last check?

@Kiro369
Copy link

Kiro369 commented Jan 16, 2025

May we get this merged?

@Nicole00 Nicole00 merged commit 9bb4c00 into vesoft-inc:master Jan 17, 2025
14 of 20 checks passed
@haoxins haoxins deleted the feat-nest-struct branch January 17, 2025 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants