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

feat: Add ability to explain dagScanNode attribute(s). #560

Merged
merged 3 commits into from
Jul 7, 2022

Conversation

shahzadlone
Copy link
Member

@shahzadlone shahzadlone commented Jun 24, 2022

Relevant issue(s)

Resolves #479

Description

Adds the spans attribute for dagScanNode to be included in the returned explain graph response.

Example:

Request:

query @explain {
  allCommits (dockey: "test-key", field: "1") {
    links {
      cid
    }
  }
}

Response:

{
  "explain": {
    "selectTopNode": {
      "selectNode": {
        "filter": null,
        "commitSelectNode": {
          "dagScanNode": {
            "spans": []{
              {
                "start": "/test-key/1",
                "end":   "/test-key/2",
              }
            }
          }
        }
      }
    }
  }
}

Tasks

  • I made sure the code is well commented, particularly in hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

Integration tests locally and only CI. Specifically make test.

Specify the platform(s) on which this was tested:

  • Manjaro Flavor of Arch Linux Running in WSL2 on Windows 11

@shahzadlone shahzadlone added feature New feature or request area/query Related to the query component action/no-benchmark Skips the action that runs the benchmark. labels Jun 24, 2022
@shahzadlone shahzadlone added this to the DefraDB v0.3 milestone Jun 24, 2022
@shahzadlone shahzadlone requested a review from a team June 24, 2022 08:33
@shahzadlone shahzadlone self-assigned this Jun 24, 2022
@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

Merging #560 (00a91d3) into develop (2c920a1) will increase coverage by 0.15%.
The diff coverage is 100.00%.

❗ Current head 00a91d3 differs from pull request most recent head 13ae9af. Consider uploading reports for the commit 13ae9af to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #560      +/-   ##
===========================================
+ Coverage    56.17%   56.33%   +0.15%     
===========================================
  Files          121      121              
  Lines        14276    14291      +15     
===========================================
+ Hits          8020     8051      +31     
+ Misses        5557     5542      -15     
+ Partials       699      698       -1     
Impacted Files Coverage Δ
query/graphql/planner/dagscan.go 78.60% <100.00%> (+4.95%) ⬆️
query/graphql/parser/filter.go 62.06% <0.00%> (ø)
query/graphql/planner/order.go
query/graphql/planner/sort.go 83.50% <0.00%> (ø)
query/graphql/planner/explain.go 68.96% <0.00%> (+5.17%) ⬆️
query/graphql/planner/commit.go 90.90% <0.00%> (+6.36%) ⬆️

query/graphql/planner/dagscan.go Outdated Show resolved Hide resolved
query/graphql/planner/dagscan.go Outdated Show resolved Hide resolved
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

Got a couple of comments for you, mostly in the tests.

query/graphql/planner/dagscan.go Outdated Show resolved Hide resolved
tests/integration/query/explain/dagscan_test.go Outdated Show resolved Hide resolved
@shahzadlone shahzadlone force-pushed the lone/feat/explain-dagscan-node-attributes branch from 5a2f92d to e7a45b8 Compare July 6, 2022 15:11
Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

Approving assuming you address Andy's todo 🙂

@shahzadlone shahzadlone force-pushed the lone/feat/explain-dagscan-node-attributes branch from e7a45b8 to 00a91d3 Compare July 6, 2022 23:25
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

Looks good - thanks for expanding the tests (is a nitpick in there but no worries if left as is)

@shahzadlone shahzadlone force-pushed the lone/feat/explain-dagscan-node-attributes branch from 00a91d3 to 13ae9af Compare July 6, 2022 23:54
@shahzadlone shahzadlone merged commit 27abfd4 into develop Jul 7, 2022
@shahzadlone shahzadlone deleted the lone/feat/explain-dagscan-node-attributes branch July 7, 2022 00:01
shahzadlone added a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…rk#560)

- Relevant issue: Resolves sourcenetwork#479 

- Description: Adds the `spans` attribute for `dagScanNode` to be included in the returned explain graph response.

- Request:
```
query @Explain {
  allCommits (dockey: "test-key", field: "1") {
    links {
      cid
    }
  }
}
```

- Response:
```
{
  "explain": {
    "selectTopNode": {
      "selectNode": {
        "filter": null,
        "commitSelectNode": {
          "dagScanNode": {
            "spans": []{
              {
                "start": "/test-key/1",
                "end":   "/test-key/2",
              }
            }
          }
        }
      }
    }
  }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/query Related to the query component feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explain the attributes of dagScanNode.
3 participants