IMPALA-13615: Support row grouping of instances based on fragment names

In the "Fragment Instances" page of a query, even though it is possible
to sort the rows based on the fragment's name, it is difficult to
distinguish between fragments and their instances.

With row grouping based on fragment's name, it becomes easier to
distinguish one fragment's instance from the other.

The lexographical sorting of instances can still be done based on
different columns, which splits the fragment's group and orders the rows
lexicographically only based on the column's values.

Row grouping has been implemented using the "RowGroup" extension
for datatables - https://datatables.net/extensions/rowgroup/.

Datatable libraries and its extensions have been added under the
directory - "www/datatables".

The datatable library's license has been updated according to
version 1.13.2, which was previously not updated.

The related row grouping extension's license has also been included.

Change-Id: If2b7ed6e2a6d605553242a7db4dbeaa7fcae4606
Reviewed-on: http://gerrit.cloudera.org:8080/22226
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Surya Hebbar
2024-12-17 22:34:37 +05:30
committed by Impala Public Jenkins
parent 067b25e526
commit e419964250
52 changed files with 61 additions and 29 deletions

11
.gitattributes vendored
View File

@@ -20,15 +20,8 @@ www/c3/c3.v7.min.css binary
www/d3.v3.min.js binary www/d3.v3.min.js binary
www/d3.v5.min.js binary www/d3.v5.min.js binary
www/dagre-d3.min.js binary www/dagre-d3.min.js binary
www/DataTables-1.10.18/js/dataTables.bootstrap.min.js binary www/datatables/**/*.min.js binary
www/DataTables-1.10.18/js/dataTables.bootstrap4.min.js biinary www/datatables/**/*.min.css binary
www/DataTables-1.10.18/js/dataTables.foundation.min.js binary
www/DataTables-1.10.18/js/dataTables.jqueryui.min.js binary
www/DataTables-1.10.18/js/dataTables.semanticui.min.js binary
www/DataTables-1.10.18/js/jquery.dataTables.min.js binary
www/datatables.min.js binary
www/datatables-1.13.2.min.js binary
www/datatables-1.13.2.min.css binary
www/highlight/highlight.pack.js binary www/highlight/highlight.pack.js binary
www/jquery/jquery-3.5.1.min.js binary www/jquery/jquery-3.5.1.min.js binary
www/pako.min.js binary www/pako.min.js binary

View File

@@ -373,26 +373,27 @@ www/jquery/: MIT license
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
www/DataTables* and www/datatables*: MIT license www/datatables/DataTables-1.13.2*: MIT license
Copyright (C) 2008-2016, SpryMedia Ltd. The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this Copyright (C) 2008-present, SpryMedia Ltd.
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be included in all copies or Permission is hereby granted, free of charge, to any person obtaining a copy of this
substantial portions of the Software. software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, The above copyright notice and this permission notice shall be included in all copies or
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR substantial portions of the Software.
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
OTHER DEALINGS IN THE SOFTWARE. PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@@ -1161,3 +1162,30 @@ The CRoaring project is under a dual license (Apache/MIT).
Users of the library may choose one or the other license. Users of the library may choose one or the other license.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
www/datatables/extensions/dataTables.rowGroup*: MIT license
MIT license
Copyright (c) 2017 SpryMedia Limited
http://datatables.net
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
--------------------------------------------------------------------------------

View File

@@ -44,8 +44,7 @@ www/c3/*
www/Chart* www/Chart*
www/d3.v3.min.js www/d3.v3.min.js
www/d3.v5.min.js www/d3.v5.min.js
www/DataTables*/* www/datatables/*
www/datatables-*.*
www/favicon.ico www/favicon.ico
www/highlight/* www/highlight/*
www/icons/* www/icons/*

View File

@@ -24,8 +24,8 @@ common-footer.tmpl) }}
<script src='{{ __common__.host-url }}/www/jquery/jquery-3.5.1.min.js'></script> <script src='{{ __common__.host-url }}/www/jquery/jquery-3.5.1.min.js'></script>
<script src='{{ __common__.host-url }}/www/bootstrap/js/bootstrap-4.3.1.min.js'></script> <script src='{{ __common__.host-url }}/www/bootstrap/js/bootstrap-4.3.1.min.js'></script>
<script src='{{ __common__.host-url }}/www/scripts/common_util.js'></script> <script src='{{ __common__.host-url }}/www/scripts/common_util.js'></script>
<link rel="stylesheet" type="text/css" href="{{ __common__.host-url }}/www/datatables-1.13.2.min.css"/> <link rel="stylesheet" type="text/css" href="{{ __common__.host-url }}/www/datatables/DataTables-1.13.2/datatables.min.css"/>
<script type="text/javascript" src="{{ __common__.host-url }}/www/datatables-1.13.2.min.js"></script> <script type="text/javascript" src="{{ __common__.host-url }}/www/datatables/DataTables-1.13.2/datatables.min.js"></script>
<link href='{{ __common__.host-url }}/www/bootstrap/css/bootstrap-4.3.1.min.css' rel='stylesheet' media='screen'> <link href='{{ __common__.host-url }}/www/bootstrap/css/bootstrap-4.3.1.min.css' rel='stylesheet' media='screen'>
<link rel='icon' href='{{ __common__.host-url }}/www/favicon.ico'> <link rel='icon' href='{{ __common__.host-url }}/www/favicon.ico'>
<style> <style>

View File

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 160 B

View File

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 148 B

View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

View File

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 146 B

View File

@@ -0,0 +1 @@
table.dataTable tr.dtrg-group th{background-color:rgba(0, 0, 0, 0.1);text-align:left}table.dataTable tr.dtrg-group.dtrg-level-0 th{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 th,table.dataTable tr.dtrg-group.dtrg-level-2 th,table.dataTable tr.dtrg-group.dtrg-level-3 th,table.dataTable tr.dtrg-group.dtrg-level-4 th,table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:rgba(0, 0, 0, 0.05);padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 th{background-color:rgba(0, 0, 0, 0.01);padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 th{background-color:rgba(0, 0, 0, 0.01);padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 th{background-color:rgba(0, 0, 0, 0.01);padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:rgba(0, 0, 0, 0.01);padding-left:4em}html.dark table.dataTable tr.dtrg-group th{background-color:rgba(255, 255, 255, 0.1)}html.dark table.dataTable tr.dtrg-group.dtrg-level-1 th{background-color:rgba(255, 255, 255, 0.05)}html.dark table.dataTable tr.dtrg-group.dtrg-level-2 th,html.dark table.dataTable tr.dtrg-group.dtrg-level-3 th,html.dark table.dataTable tr.dtrg-group.dtrg-level-4 th,html.dark table.dataTable tr.dtrg-group.dtrg-level-5 th{background-color:rgba(255, 255, 255, 0.01)}

View File

@@ -0,0 +1,4 @@
/*! RowGroup 1.5.1
* © SpryMedia Ltd - datatables.net/license
*/
!function(e){var n,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return e(t,window,document)}):"object"==typeof exports?(n=require("jquery"),o=function(t,r){r.fn.dataTable||require("datatables.net")(t,r)},"undefined"==typeof window?module.exports=function(t,r){return t=t||window,r=r||n(t),o(t,r),e(r,0,t.document)}:(o(window,n),module.exports=e(n,window,window.document))):e(jQuery,window,document)}(function(i,t,r){"use strict";function a(t,r){if(!l.versionCheck||!l.versionCheck("1.11"))throw"RowGroup requires DataTables 1.11 or newer";if(this.c=i.extend(!0,{},l.defaults.rowGroup,a.defaults,r),this.s={dt:new l.Api(t)},this.dom={},r=this.s.dt.settings()[0],t=r.rowGroup)return t;(r.rowGroup=this)._constructor()}var l=i.fn.dataTable;return i.extend(a.prototype,{dataSrc:function(t){var r;return void 0===t?this.c.dataSrc:(r=this.s.dt,this.c.dataSrc=t,i(r.table().node()).triggerHandler("rowgroup-datasrc.dt",[r,t]),this)},disable:function(){return this.c.enable=!1,this},enable:function(t){return!1===t?this.disable():(this.c.enable=!0,this)},enabled:function(){return this.c.enable},_constructor:function(){var e=this,t=this.s.dt,n=t.settings()[0];t.on("draw.dtrg",function(t,r){e.c.enable&&n===r&&e._draw()}),t.on("column-visibility.dt.dtrg responsive-resize.dt.dtrg",function(){e._adjustColspan()}),t.on("destroy",function(){t.off(".dtrg")})},_adjustColspan:function(){i("tr."+this.c.className,this.s.dt.table().body()).find("th:visible, td:visible").attr("colspan",this._colspan())},_colspan:function(){return this.s.dt.columns().visible().reduce(function(t,r){return t+r},0)},_draw:function(){var t=this.s.dt,t=this._group(0,t.rows({page:"current"}).indexes());this._groupDisplay(0,t)},_group:function(t,r){for(var e,n=Array.isArray(this.c.dataSrc)?this.c.dataSrc:[this.c.dataSrc],o=l.util.get(n[t]),i=this.s.dt,a=[],s=0,d=r.length;s<d;s++){var u,c=r[s];null==(u=o(i.row(c).data(),t))&&(u=this.c.emptyDataGroup),void 0!==e&&u===e||(a.push({dataPoint:u,rows:[]}),e=u),a[a.length-1].rows.push(c)}if(void 0!==n[t+1])for(s=0,d=a.length;s<d;s++)a[s].children=this._group(t+1,a[s].rows);return a},_groupDisplay:function(t,r){for(var e,n=this.s.dt,o=0,i=r.length;o<i;o++){var a,s=r[o],d=s.dataPoint,u=s.rows;this.c.startRender&&(e=this.c.startRender.call(this,n.rows(u),d,t),a=this._rowWrap(e,this.c.startClassName,t))&&a.insertBefore(n.row(u[0]).node()),this.c.endRender&&(e=this.c.endRender.call(this,n.rows(u),d,t),a=this._rowWrap(e,this.c.endClassName,t))&&a.insertAfter(n.row(u[u.length-1]).node()),s.children&&this._groupDisplay(t+1,s.children)}},_rowWrap:function(t,r,e){return null==(t=null!==t&&""!==t?t:this.c.emptyDataGroup)?null:("object"==typeof t&&t.nodeName&&"tr"===t.nodeName.toLowerCase()?i(t):t instanceof i&&t.length&&"tr"===t[0].nodeName.toLowerCase()?t:i("<tr/>").append(i("<th/>").attr("colspan",this._colspan()).attr("scope","row").append(t))).addClass(this.c.className).addClass(r).addClass("dtrg-level-"+e)}}),a.defaults={className:"dtrg-group",dataSrc:0,emptyDataGroup:"No group",enable:!0,endClassName:"dtrg-end",endRender:null,startClassName:"dtrg-start",startRender:function(t,r){return r}},a.version="1.5.1",i.fn.dataTable.RowGroup=a,i.fn.DataTable.RowGroup=a,l.Api.register("rowGroup()",function(){return this}),l.Api.register("rowGroup().disable()",function(){return this.iterator("table",function(t){t.rowGroup&&t.rowGroup.enable(!1)})}),l.Api.register("rowGroup().enable()",function(r){return this.iterator("table",function(t){t.rowGroup&&t.rowGroup.enable(void 0===r||r)})}),l.Api.register("rowGroup().enabled()",function(){var t=this.context;return!(!t.length||!t[0].rowGroup)&&t[0].rowGroup.enabled()}),l.Api.register("rowGroup().dataSrc()",function(r){return void 0===r?this.context[0].rowGroup.dataSrc():this.iterator("table",function(t){t.rowGroup&&t.rowGroup.dataSrc(r)})}),i(r).on("preInit.dt.dtrg",function(t,r,e){var n,o;"dt"===t.namespace&&(t=r.oInit.rowGroup,n=l.defaults.rowGroup,t||n)&&(o=i.extend({},n,t),!1!==t)&&new a(r,o)}),l});

View File

@@ -18,6 +18,10 @@ under the License.
--> -->
{{> www/common-header.tmpl }} {{> www/common-header.tmpl }}
<link rel="stylesheet" type="text/css" href="{{ __common__.host-url }}/www/datatables/extensions/dataTables.rowGroup-1.5.1.min.css"/>
<script type="text/javascript" src="{{ __common__.host-url }}/www/datatables/extensions/dataTables.rowGroup-1.5.1.min.js"></script>
{{> www/query_detail_tabs.tmpl }} {{> www/query_detail_tabs.tmpl }}
<br/> <br/>
{{?backend_instances}} {{?backend_instances}}
@@ -97,6 +101,9 @@ $(document).ready(() => {
{data: 'current_state'}, {data: 'current_state'},
{data: 'done'}, {data: 'done'},
{data: 'time_since_last_heard_from'}], {data: 'time_since_last_heard_from'}],
"rowGroup": {
dataSrc : "fragment_name"
},
"order": [[ 0, "desc" ]], "order": [[ 0, "desc" ]],
"pageLength": 100 "pageLength": 100
}); });