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

fix(server): kneigbor-api has unmatched edge type with server #2699

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

LiJie20190102
Copy link
Contributor

@LiJie20190102 LiJie20190102 commented Nov 27, 2024

Purpose of the PR

Main Changes

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
graphs/graph_demo1/traversers/kneighbor
    {
	"countOnly": false,
	"limit": 10000000,
	"maxDepth": 1,
	"pathWithEdge": false,
	"steps": {
		"direction": "BOTH",
		"maxDegree": 1000,
		"skipDegree": 0,
		"vSteps": []
	},
	"withEdge": false,
	"withPath": true,
	"withVertex": false
}


**result:**

{
	"kneighbor": [
		"2:car1!2",
		"2:car2!4"
	],
	"size": 2,
	"paths": [
		{
			"objects": [
				"1:zhangsan",
				"2:car1!2"
			]
		},
		{
			"objects": [
				"1:zhangsan",
				"2:car2!4"
			]
		}
	],
	"vertices": [],
	"edges": []
}
graphs/graph_demo1/traversers/kneighbor
    {
	"countOnly": false,
	"limit": 10000000,
	"maxDepth": 1,
	"pathWithEdge": false,
	"steps": {
		"direction": "BOTH",
		"maxDegree": 1000,
		"skipDegree": 0,
		"vSteps": []
	},
	"withEdge": true,
	"withPath": true,
	"withVertex": true
}


**result:**

{
	"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"
			}
		}
	]
}

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. api Changes of API bug Something isn't working labels Nov 27, 2024
@LiJie20190102
Copy link
Contributor Author

@imbajin Please help review it

Copy link
Member

@imbajin imbajin left a comment

Choose a reason for hiding this comment

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

Good to see the tests meets expectations

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 27, 2024
@imbajin imbajin requested a review from javeme November 27, 2024 09:39
Iterator<?> iterEdge = Collections.emptyIterator();
if (request.withPath) {
Iterator<Edge> iterEdge = Collections.emptyIterator();
if (request.withPath && request.withEdge) {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like we cut the returning ids branch?
due to it is not easy for the client to determine whether it is an edge id or an edge object?

@javeme
Copy link
Contributor

javeme commented Dec 19, 2024

@imbajin imbajin merged commit a369ef1 into apache:master Dec 20, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Changes of API bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants