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

Explain the attributes of groupNode #525

Closed
shahzadlone opened this issue Jun 14, 2022 · 0 comments · Fixed by #641
Closed

Explain the attributes of groupNode #525

shahzadlone opened this issue Jun 14, 2022 · 0 comments · Fixed by #641
Assignees
Labels
area/query Related to the query component feature New feature or request
Milestone

Comments

@shahzadlone
Copy link
Member

Subtask of #35.

Explain the attributes of groupNode.

@shahzadlone shahzadlone self-assigned this Jul 9, 2022
@shahzadlone shahzadlone added feature New feature or request area/query Related to the query component labels Jul 9, 2022
@shahzadlone shahzadlone added this to the DefraDB v0.3 milestone Jul 9, 2022
shahzadlone added a commit that referenced this issue Jul 23, 2022
- Resolves #525 

- Description:
	Makes `groupNode` explainable.
	Explains the child selects list of attributes of `groupNode`.
	Explains the attribute that represents the field the `groupBy` is on.
	Includes integration tests for various types of `groupNode` explanations.


- Request:
```
query @Explain {
	author (
		groupBy: [age, verified],
	) {
		age
		_group(filter: {age: {_gt: 63}}) {
			name
		}
	}
}
```

- Response:
```
{
  "data": [
    {
      "explain": {
        "selectTopNode": {
          "groupNode": {
            "groupByFields": [ "age", "verified" ],
            "childSelects": [
              {
                "collectionName": "author",
                "filter": {
                  "age": {
                    "_gt": 63
                  }
                },
                "docKeys": null,
                "groupBy": null,
                "limit": null,
                "orderBy": null
              }
            ],
            "selectNode": {
              "filter": null,
              "scanNode": {
                "collectionID": "3",
                "collectionName": "author",
                "filter": null,
                "spans": [
                  {
                    "end": "/4",
                    "start": "/3"
                  }
                ]
              }
            }
          }
        }
      }
    }
  ]
}
```
shahzadlone added a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
…cenetwork#641)


- Resolves sourcenetwork#525 

- Description:
	Makes `groupNode` explainable.
	Explains the child selects list of attributes of `groupNode`.
	Explains the attribute that represents the field the `groupBy` is on.
	Includes integration tests for various types of `groupNode` explanations.


- Request:
```
query @Explain {
	author (
		groupBy: [age, verified],
	) {
		age
		_group(filter: {age: {_gt: 63}}) {
			name
		}
	}
}
```

- Response:
```
{
  "data": [
    {
      "explain": {
        "selectTopNode": {
          "groupNode": {
            "groupByFields": [ "age", "verified" ],
            "childSelects": [
              {
                "collectionName": "author",
                "filter": {
                  "age": {
                    "_gt": 63
                  }
                },
                "docKeys": null,
                "groupBy": null,
                "limit": null,
                "orderBy": null
              }
            ],
            "selectNode": {
              "filter": null,
              "scanNode": {
                "collectionID": "3",
                "collectionName": "author",
                "filter": null,
                "spans": [
                  {
                    "end": "/4",
                    "start": "/3"
                  }
                ]
              }
            }
          }
        }
      }
    }
  ]
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant