-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix(client): kneigbor-api has unmatched edge type with server #644
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Although using
<?>
may take effect(no add/update operation here), it is still strange why the restriction of generics has been modified to arbitrary here.It is possible that the server-side changes did not meet expectations?
Wanna to know in what case do I need to pass in a non-Edge Edge?(Is it because the definition of server-side generics is too broad?)
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.
server code
![image](https://private-user-images.githubusercontent.com/53458004/390212190-a7fe9a41-4770-4b82-920a-ae2b10c9b8e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Nzk0MDQsIm5iZiI6MTczODk3OTEwNCwicGF0aCI6Ii81MzQ1ODAwNC8zOTAyMTIxOTAtYTdmZTlhNDEtNDc3MC00YjgyLTkyMGEtYWUyYjEwYzliOGU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAxNDUwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwMzAxOTJiZWZmMmQzOTJhNzkxODkwYjUzOTRlMmU4N2Y5Y2ZkYzQ2MzNhMTQ0ZTcxNTM3NmYxNmUzODBmNTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Fz6r70-72objRQF0C7j0sQzEHcN9LbnD-AVNYIUWkLQ)
org.apache.hugegraph.api.traversers.KneighborAPI#post
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 mean the change in
server
maybe not suitable.A better approach could be to adjust the
![image](https://private-user-images.githubusercontent.com/17706099/390293020-ca0ce881-b0ae-4ff1-a899-fa569ef76805.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Nzk0MDQsIm5iZiI6MTczODk3OTEwNCwicGF0aCI6Ii8xNzcwNjA5OS8zOTAyOTMwMjAtY2EwY2U4ODEtYjBhZS00ZmYxLWE4OTktZmE1NjllZjc2ODA1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAxNDUwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiYjI5YjExNDZlMGJiMjdhZGI5N2QwODMwZGM1M2ZjZTFjZjhmYmYzZWQ5ZjNkMzg1MTgzMjBiNzg1ZDk2MDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.FQxly4OT81HK2lv3iiO4fIVndZtddqDJZ05_XV6VZao)
<>
type of server? You can take a look at itThere 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.
How about this:If 'with_idge' is' false ', we will not return any information about the edge; If 'with-vertex' is' false 'and does not return vertex information, the' kneigbor 'parameter has already returned a set of vertex IDs
![image](https://private-user-images.githubusercontent.com/53458004/390307580-e8d23fbb-57fc-4c77-9c73-d8f452d126f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Nzk0MDQsIm5iZiI6MTczODk3OTEwNCwicGF0aCI6Ii81MzQ1ODAwNC8zOTAzMDc1ODAtZThkMjNmYmItNTdmYy00Yzc3LTljNzMtZDhmNDUyZDEyNmYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAxNDUwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhZjQ0YWRmZjg2MmI3MzA1NzU1NjIxZDNiMmZkZDM3MjNmYWYxYjU4NjZiYWNmMjFiNTU4MmI1MTYxZTY3OTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.m2KA-GquN_5YsmhSTS9e0IDcCPwPGRQiFMacndFeuHA)
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.
Looks okay, but what effect does the iterator returned earlier? Do you have to test what the potential effect is there? See if the test can pass rightly
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.
if with_edge is false:
{ "kneighbor": [ "2:car1!2", "2:car2!4" ], "size": 2, "paths": [ { "objects": [ "1:zhangsan", "2:car1!2" ] }, { "objects": [ "1:zhangsan", "2:car2!4" ] } ], "vertices": [ { "id": "2:car2!4", "label": "car", "type": "vertex", "properties": { "age": 4, "qsdi_task_id": "car2_task_id_test", "qsdi_record_id": "test_record_id", "name": "car2", "qsdi_data_source": "1" } }, { "id": "1:zhangsan", "label": "people", "type": "vertex", "properties": { "age": 55, "qsdi_record_id": "926133154860048384", "name": "zhangsan", "qsdi_data_source": "1" } }, { "id": "2:car1!2", "label": "car", "type": "vertex", "properties": { "age": 2, "qsdi_task_id": "car1_task_id_test", "qsdi_record_id": "car1_log_id_test", "name": "car1", "qsdi_data_source": "1" } } ], "edges": [ "S1:zhangsan>3>3>>S2:car2!4", "S1:zhangsan>3>3>>S2:car1!2" ] }
if with_edge is true:
{ "kneighbor": [ "2:car1!2", "2:car2!4" ], "size": 2, "paths": [ { "objects": [ "1:zhangsan", "2:car1!2" ] }, { "objects": [ "1:zhangsan", "2:car2!4" ] } ], "vertices": [ { "id": "2:car2!4", "label": "car", "type": "vertex", "properties": { "age": 4, "qsdi_task_id": "car2_task_id_test", "qsdi_record_id": "test_record_id", "name": "car2", "qsdi_data_source": "1" } }, { "id": "1:zhangsan", "label": "people", "type": "vertex", "properties": { "age": 55, "qsdi_record_id": "926133154860048384", "name": "zhangsan", "qsdi_data_source": "1" } }, { "id": "2:car1!2", "label": "car", "type": "vertex", "properties": { "age": 2, "qsdi_task_id": "car1_task_id_test", "qsdi_record_id": "car1_log_id_test", "name": "car1", "qsdi_data_source": "1" } } ], "edges": [ { "id": "S1:zhangsan>3>3>>S2:car2!4", "label": "driver_single", "type": "edge", "outV": "1:zhangsan", "outVLabel": "people", "inV": "2:car2!4", "inVLabel": "car", "properties": { "qsdi_task_id": "zhangsan_car2_rask_id_test", "qsdi_record_id": "926133802515111937", "name": "ride12", "driver_count": 23, "qsdi_data_source": "1" } }, { "id": "S1:zhangsan>3>3>>S2:car1!2", "label": "driver_single", "type": "edge", "outV": "1:zhangsan", "outVLabel": "people", "inV": "2:car1!2", "inVLabel": "car", "properties": { "qsdi_record_id": "926133804008284160", "name": "ride88", "driver_count": 88, "qsdi_data_source": "1" } } ] }
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.
THX, could try to submit a PR in server (or in your own forked repo to test the CI)
BTW, test/ in local env is also fine:)
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.
after apache/incubator-hugegraph#2699 merged, we don't need to change
Set<Edge> edges
?