Skip to content

Commit

Permalink
Remap query plan arguments to the root object
Browse files Browse the repository at this point in the history
- Run skipped boltMapping tests
  • Loading branch information
pe4cey committed Oct 5, 2017
1 parent b2b8ce0 commit 8130a43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
18 changes: 5 additions & 13 deletions src/shared/services/bolt/boltMappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,16 @@ export function extractPlan (result, calculateTotalDbHits = false) {
const boltPlanToRESTPlanShared = plan => {
return {
operatorType: plan.operatorType,
LegacyExpression: plan.arguments.LegacyExpression,
ExpandExpression: plan.arguments.ExpandExpression,
DbHits: plan.dbHits,
Rows: plan.rows,
EstimatedRows: plan.arguments.EstimatedRows,
identifiers: plan.identifiers,
Index: plan.arguments.Index,
children: plan.children.map(boltPlanToRESTPlanShared)
children: plan.children.map(_ => ({
...boltPlanToRESTPlanShared(_),
..._.arguments
}))
}
}
let obj = boltPlanToRESTPlanShared(rawPlan)
obj['runtime-impl'] = rawPlan.arguments['runtime-impl']
obj['planner-impl'] = rawPlan.arguments['planner-impl']
obj['version'] = rawPlan.arguments['version']
obj['KeyNames'] = rawPlan.arguments['KeyNames']
obj['planner'] = rawPlan.arguments['planner']
obj['runtime'] = rawPlan.arguments['runtime']
obj['Signature'] = rawPlan.arguments['Signature']
let obj = { ...boltPlanToRESTPlanShared(rawPlan), ...rawPlan.arguments }

if (calculateTotalDbHits === true) {
obj.totalDbHits = collectHits(obj)
Expand Down
4 changes: 2 additions & 2 deletions src/shared/services/bolt/boltMappings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ describe('boltMappings', () => {
expect(extractedPlan.Signature).toEqual('Signature')
}

test.skip('should extract plan from result summary', () => {
test('should extract plan from result summary', () => {
// Given
const result = {
summary: {
Expand All @@ -382,7 +382,7 @@ describe('boltMappings', () => {
checkExtractedPlan(extractedPlan)
})

test.skip('should extract profile from result summary', () => {
test('should extract profile from result summary', () => {
// Given
const profile = createPlan()
profile.dbHits = 20
Expand Down

0 comments on commit 8130a43

Please sign in to comment.