Repository: ambari Updated Branches: refs/heads/trunk 11e2563f7 -> aecc890ee
AMBARI-20519. Runtime filtering is not rendering properly (pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aecc890e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aecc890e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aecc890e Branch: refs/heads/trunk Commit: aecc890eec3e1e075f1a8b42aeda4efa0e250da5 Parents: 11e2563 Author: pallavkul <[email protected]> Authored: Tue May 9 16:27:49 2017 +0530 Committer: pallavkul <[email protected]> Committed: Tue May 9 16:27:49 2017 +0530 ---------------------------------------------------------------------- .../ui/app/utils/hive-explainer/processor.js | 12 ++++++------ .../ui/app/utils/hive-explainer/renderer.js | 16 ++++++++++++---- .../ui/app/utils/hive-explainer/transformer.js | 6 +++--- 3 files changed, 21 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/aecc890e/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js index 1a6d4b3..79d110f 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/processor.js @@ -264,10 +264,10 @@ export function getEdgesWithCorrectedUnion(edges) { function findAllOutputOperators(vertices, outputOperatorsList, edges, patterns) { vertices.forEach(cEdge => { edges.push(cEdge); - let outputOperator = cEdge["OutputOperators:"]; - if(outputOperator) { - patterns.push({outputOperator:outputOperator.substring(1, outputOperator.length-1), cEdge:[edges[edges.length-4], edges[edges.length-3], edges[edges.length-2], edges[edges.length-1]]}); - outputOperatorsList.push({outputOperator:outputOperator.substring(1, outputOperator.length-1), cEdge:edges}); + let outputOperator = cEdge["outputOperator:"]; + if(outputOperator && outputOperator.length) { + patterns.push({outputOperator:outputOperator[0], cEdge:[edges[edges.length-4], edges[edges.length-3], edges[edges.length-2], edges[edges.length-1]]}); + outputOperatorsList.push({outputOperator:outputOperator[0], cEdge:edges}); } findAllOutputOperators(cEdge._children, outputOperatorsList, edges, patterns); }); @@ -303,7 +303,7 @@ function findPatternParent(edges, patternArray) { if(cSubChild && cSubChild["OperatorId:"] === patternArray[0]["OperatorId:"]){ if(cChild._children.length>1){ cChild._children = [cChild._children[0]]; - cChild["OutputOperators:"] = patternArray[1]["OutputOperators:"]; + cChild["outputOperator:"] = patternArray[1]["outputOperator:"]; newVertex = Object.assign(patternArray[2], { "_operator":"Build Bloom Filter", "_children":[], @@ -314,7 +314,7 @@ function findPatternParent(edges, patternArray) { ...patternArray[3].groups||[doCloneAndOmit(patternArray[3], ['_groups'])]] }); } - } else if(cSubChild && cSubChild["OperatorId:"] === patternArray[3]["OperatorId:"]){ + } else if(cSubChild && patternArray[patternArray.length-1] && cSubChild["OperatorId:"] === patternArray[patternArray.length-1]["OperatorId:"]){ cChild._children = newVertex ? [newVertex]:[]; } else { findPatternParent(cChild, patternArray); http://git-wip-us.apache.org/repos/asf/ambari/blob/aecc890e/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js index c880614..d0a3e0b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js @@ -500,10 +500,18 @@ function getConnectionPath(connector, svg, container, data){ } path.push(pSource); const offsetY = svg.node().getBoundingClientRect().top; + let isEdgeReversed = false, edgeReversalVal; return path.reduce((accumulator, cPoint, index) => { if(index === 0) { + if(cPoint.x > (cPoint.y - offsetY)) { + edgeReversalVal = cPoint.x; + isEdgeReversed = true; + } return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n`; } else { + if(isEdgeReversed && path.length === 4 && index !== path.length-1 && edgeReversalVal > cPoint.x){ + return accumulator + `L ${cPoint.x+150}, ${cPoint.y - offsetY}\n`; + } return accumulator + `L ${cPoint.x}, ${cPoint.y - offsetY}\n`; } }, ''); @@ -543,9 +551,9 @@ function getConnectionPathArrow(connector, svg, container){ if(path.length === 2){ if(index === 0) { if(cPoint.x > 0){ - return accumulator + `M ${cPoint.x + 60}, ${cPoint.y - offsetY-15} V 0, ${(((cPoint.y - offsetY-15)/100)*100)+35} L ${cPoint.x + 50}, ${cPoint.y - offsetY} Z\n`; + return accumulator + `M ${cPoint.x + 45}, ${cPoint.y - offsetY-7} V 0, ${(((cPoint.y - offsetY-15)/100)*100)+23} L ${cPoint.x + 40}, ${cPoint.y - offsetY} Z\n`; } else { - return accumulator + `M ${cPoint.x + 60}, ${cPoint.y - offsetY-15} V 0, ${(((cPoint.y - offsetY-15)/100)*100)+35} L ${cPoint.x + 50}, ${cPoint.y - offsetY} Z\n`; + return accumulator + `M ${cPoint.x + 45}, ${cPoint.y - offsetY-7} V 0, ${(((cPoint.y - offsetY-15)/100)*100)+23} L ${cPoint.x + 40}, ${cPoint.y - offsetY} Z\n`; } } else { return accumulator; @@ -553,9 +561,9 @@ function getConnectionPathArrow(connector, svg, container){ } else { if(index === 0) { if(cPoint.x > 0) { - return accumulator + `M ${cPoint.x + 60}, ${cPoint.y - offsetY-15} V 0, ${(((cPoint.y - offsetY-15)/100)*100)+35} L ${cPoint.x + 50}, ${cPoint.y - offsetY} Z\n`; + return accumulator + `M ${cPoint.x + 45}, ${cPoint.y - offsetY-7} V 0, ${(((cPoint.y - offsetY-15)/100)*100)+23} L ${cPoint.x + 40}, ${cPoint.y - offsetY} Z\n`; } else { - return accumulator + `M ${cPoint.x + 60}, ${cPoint.y - offsetY+15} V 0, ${10*6} L ${cPoint.x + 50}, ${cPoint.y - offsetY} Z\n`; + return accumulator + `M ${cPoint.x + 45}, ${cPoint.y - offsetY+9} V 0, 67 L ${cPoint.x + 40}, ${cPoint.y - offsetY} Z\n`; } } else { return accumulator; http://git-wip-us.apache.org/repos/asf/ambari/blob/aecc890e/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js index 57fff1e..9dbbb00 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js @@ -506,10 +506,10 @@ function findAllOperatorsInTargetVertex(node, resultsAggregator, targetNode) { } function findAllOperatorsInSourceVertex(node, resultsAggregator, srcNode) { - let outputOperator = node["OutputOperators:"]; + let outputOperator = node["outputOperator:"]; if(outputOperator) { - resultsAggregator.push(outputOperator.substring(1, outputOperator.length-1)); - srcNode[outputOperator.substring(1, outputOperator.length-1)] = node; + resultsAggregator.push(outputOperator[0]); + srcNode[outputOperator[0]] = node; } node._children.forEach(cChild => findAllOperatorsInSourceVertex(cChild, resultsAggregator, srcNode)); if(!node._children) {
