sarutak commented on code in PR #55787:
URL: https://github.com/apache/spark/pull/55787#discussion_r3225738479
##########
sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/allexecutionspage.js:
##########
@@ -146,83 +238,52 @@ $(document).ready(function () {
if (sel) {
d.status = sel;
}
+ d.groupSubExecution = groupSubExecEnabled ? "true" : "false";
},
dataSrc: function (json) { return json.aaData; },
error: function () {
$("#sql-table_processing").css("display", "none");
}
},
- columns: [
- {
- data: "id", name: "id", title: "ID",
- render: function (data, type) {
- if (type !== "display") return data;
- var basePath = uiRoot + appBasePath;
- return '<a href="' + basePath + '/SQL/execution/?id=' + data +
'">' +
- data + '</a>';
- }
- },
- {
- data: "queryId", name: "queryId", title: "Query ID",
- orderable: false,
- render: function (data, type) {
- if (type !== "display" || !data) return data || "";
- return '<span title="' + data + '">' + data.substring(0, 8) +
'...</span>';
- }
- },
- {
- data: "status", name: "status", title: "Status",
- render: function (data, type) {
- if (type !== "display") return data;
- return statusBadge(data);
- }
- },
- {
- data: "description", name: "description", title: "Description",
- render: function (data, type, row) {
- if (type !== "display") return data || "";
- return descriptionHtml({ id: row.id, description: data });
- }
- },
- {
- data: "submissionTime", name: "submissionTime", title: "Submitted",
- render: function (data, type) {
- if (type !== "display") return data;
- return formatDateSql(data);
- }
- },
- {
- data: "duration", name: "duration", title: "Duration",
- render: function (data, type) {
- if (type !== "display") return data;
- return formatDurationSql(data);
- }
- },
- {
- data: "jobIds", name: "jobIds", title: "Succeeded Jobs",
- orderable: false,
- render: function (data, type) {
- if (type !== "display") return (data || []).join(",");
- return jobIdLinks(data || []);
- }
- },
- {
- data: "errorMessage", name: "errorMessage", title: "Error Message",
- orderable: false,
- render: function (data, type) {
- if (type !== "display" || !data) return data || "";
- if (data.length > 100) {
- return '<span title="' + escapeHtml(data) + '">' +
- escapeHtml(data.substring(0, 100)) + '...</span>';
- }
- return escapeHtml(data);
- }
- }
- ],
+ columns: columns,
order: [[0, "desc"]],
language: { search: "Search: " }
});
+ // Child-row expansion for sub-executions. Sub data is embedded per root
row
+ // in the server payload (`row.subExecutions`), so no second fetch is
needed.
+ if (groupSubExecEnabled) {
+ $("#sql-table tbody").on("click", "a.toggle-sub-exec", function (e) {
+ e.preventDefault();
+ var tr = $(this).closest("tr");
+ var dtRow = table.row(tr);
+ var rowData = dtRow.data();
+ var subs = (rowData && rowData.subExecutions) || [];
+ if (dtRow.child.isShown()) {
+ dtRow.child.hide();
+ tr.removeClass("shown");
+ $(this).text("+" + subs.length + " sub");
+ } else {
+ var basePath = uiRoot + appBasePath;
+ var html = '<table class="table table-sm table-bordered mb-0
sub-exec-table">';
+ html += '<thead><tr><th>ID</th><th>Status</th><th>Description</th>' +
+ '<th>Duration</th><th>Succeeded Jobs</th></tr></thead><tbody>';
+ subs.forEach(function (child) {
+ html += '<tr><td><a href="' + basePath + '/SQL/execution/?id=' +
+ child.id + '">' + child.id + '</a></td>';
+ html += '<td>' + statusBadge(child.status) + '</td>';
+ html += '<td>' + escapeHtml(child.description || "") + '</td>';
Review Comment:
Parent rows use `descriptionHtml()` which wraps in a link to the execution
detail page, but child rows use plain `escapeHtml()`. Is this intentional, or
should child rows also use `descriptionHtml({ id: child.id, description:
child.description })`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]