This is an automated email from the ASF dual-hosted git repository.

gengliang pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 27a9c1d  [SPARK-31558][UI] Code clean up in spark-sql-viz.js
27a9c1d is described below

commit 27a9c1da6f9ced760c33ff624c2eadc5f6a85dd9
Author: Gengliang Wang <gengliang.w...@databricks.com>
AuthorDate: Sat Apr 25 13:43:52 2020 -0700

    [SPARK-31558][UI] Code clean up in spark-sql-viz.js
    
    ### What changes were proposed in this pull request?
    
    1. Remove console.log(), which seems unnecessary in the releases.
    2. Replace the double equals to triple equals
    3. Reuse jquery selector.
    
    ### Why are the changes needed?
    
    For better code quality.
    
    ### Does this PR introduce any user-facing change?
    
    No
    
    ### How was this patch tested?
    
    Existing tests + manual test.
    
    Closes #28333 from gengliangwang/removeLog.
    
    Authored-by: Gengliang Wang <gengliang.w...@databricks.com>
    Signed-off-by: Gengliang Wang <gengliang.w...@databricks.com>
    (cherry picked from commit f59ebdef5b9c03dab99835527554ba8bebe38548)
    Signed-off-by: Gengliang Wang <gengliang.w...@databricks.com>
---
 .../org/apache/spark/sql/execution/ui/static/spark-sql-viz.js  | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
 
b/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
index bded921..724cec1 100644
--- 
a/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
+++ 
b/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
@@ -61,7 +61,7 @@ function planVizContainer() { return 
d3.select("#plan-viz-graph"); }
  * node, it will display the details of this SparkPlan node in the right.
  */
 function setupTooltipForSparkPlanNode(nodeId) {
-  var nodeTooltip = d3.select("#plan-meta-data-" + nodeId).text()
+  var nodeTooltip = d3.select("#plan-meta-data-" + nodeId).text();
   d3.select("svg g .node_" + nodeId)
     .on('mouseover', function(d) {
       var domNode = d3.select(this).node();
@@ -127,10 +127,8 @@ function preprocessGraphLayout(g) {
  */
 function resizeSvg(svg) {
   var allClusters = svg.selectAll("g rect")[0];
-  console.log(allClusters);
   var startX = -PlanVizConstants.svgMarginX +
     toFloat(d3.min(allClusters, function(e) {
-      console.log(e);
       return getAbsolutePosition(d3.select(e)).x;
     }));
   var startY = -PlanVizConstants.svgMarginY +
@@ -183,7 +181,7 @@ function getAbsolutePosition(d3selection) {
     // Climb upwards to find how our parents are translated
     obj = d3.select(obj.node().parentNode);
     // Stop when we've reached the graph container itself
-    if (obj.node() == planVizContainer().node()) {
+    if (obj.node() === planVizContainer().node()) {
       break;
     }
   }
@@ -215,8 +213,8 @@ function postprocessForAdditionalMetrics() {
   checkboxNode.click(function() {
       onClickAdditionalMetricsCheckbox($(this));
   });
-  var isChecked = window.localStorage.getItem("stageId-and-taskId-checked") == 
"true";
-  $("#stageId-and-taskId-checkbox").prop("checked", isChecked);
+  var isChecked = window.localStorage.getItem("stageId-and-taskId-checked") 
=== "true";
+  checkboxNode.prop("checked", isChecked);
   onClickAdditionalMetricsCheckbox(checkboxNode);
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to