Skip to content

Commit

Permalink
Made TVF display consistent in execution plan
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Nov 17, 2023
1 parent 6497d27 commit 9670131
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MarkMpn.Sql4Cds.Controls/ExecutionPlanView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ protected override void OnPaint(PaintEventArgs e)

if (imageName == "AdaptiveIndexSpoolNode")
imageName = "IndexSpoolNode";
else if (imageName == "OpenJsonNode" || imageName == "SystemFunctionNode")
imageName = "ExecuteMessageNode";

using (var stream = GetType().Assembly.GetManifestResourceStream(GetType(), "Images." + imageName + ".ico"))
{
Expand Down
5 changes: 5 additions & 0 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/ExecuteMessageNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -704,5 +704,10 @@ IRootExecutionPlanNodeInternal[] IRootExecutionPlanNodeInternal.FoldQuery(NodeCo
FoldQuery(context, hints);
return new[] { this };
}

public override string ToString()
{
return $"Table Valued Function\r\n[{MessageName}]";
}
}
}
5 changes: 5 additions & 0 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/OpenJsonNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,5 +440,10 @@ public override object Clone()
_conversions = _conversions,
};
}

public override string ToString()
{
return $"Table Valued Function\r\n[OPENJSON_{(Schema == null ? "DEFAULT" : "EXPLICIT")}]";
}
}
}
5 changes: 5 additions & 0 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/SystemFunctionNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ private string PrefixWithAlias(string columnName)

return Alias + "." + columnName;
}

public override string ToString()
{
return $"Table Valued Function\r\n[{SystemFunction}]";
}
}

enum SystemFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,10 @@ private ExecutionPlanNode ConvertExecutionPlanNode(IExecutionPlanNode node, Time
converted.Type = "udx";
else if (converted.Type == "adaptiveIndexSpool")
converted.Type = "indexSpool";
else if (converted.Type == "openJson")
converted.Type = "tableValuedFunction";
else if (converted.Type == "systemFunction")
converted.Type = "tableValuedFunction";

// Get the filtered list of properties
var typeDescriptor = new ExecutionPlanNodeTypeDescriptor(node, !executed, _ => null);
Expand Down

0 comments on commit 9670131

Please sign in to comment.