Skip to content

[SPARK-56140][UI] Add server-side pagination for SQL tab query listing#55073

Open
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-56140
Open

[SPARK-56140][UI] Add server-side pagination for SQL tab query listing#55073
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-56140

Conversation

@yaooqinn
Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Switch the SQL tab from client-side DataTables (fetching all executions at once) to server-side pagination, following the stagepage.js pattern.

Server-side (SqlResource.sqlTable):

  • New /sql/sqlTable GET endpoint returning {aaData, recordsTotal, recordsFiltered}
  • Accepts DataTables server-side parameters: start, length, order[0][column], order[0][dir], search[value]
  • Supports sorting by id, status, description, submissionTime, duration
  • Supports search filtering across description, status, and id

Client-side (allexecutionspage.js):

  • Rewritten to use serverSide: true with ajax config
  • Pagination, sorting, and search handled server-side
  • Length menu: 20, 50, 100, All

Why are the changes needed?

Long-running applications (ThriftServer, Spark Connect Server) can accumulate 50K+ SQL executions. The previous client-side approach fetched all executions in one JSON response, causing browser strain. Server-side pagination fetches only the visible page.

Does this PR introduce any user-facing change?

Yes — SQL tab now paginates server-side with length menu options.

How was this patch tested?

Compilation verified. Manual testing with TPC-DS SF100.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: GitHub Copilot (Claude Opus 4.6)

@yaooqinn
Copy link
Copy Markdown
Member Author

Screenshots — Server-Side Pagination

Live Spark UI (9 executions, "Showing 1 to 9 of 9 entries"):
live-ui

History Server (32 executions from TPC-DS run, paginated 20 per page, "Showing 1 to 20 of 32 entries"):
shs

Both show: server-side pagination with length menu (20/50/100/All), status filter dropdown, search box, sortable columns, status badges, job links, error messages.

Switch the SQL tab from client-side DataTables (fetching all executions
at once) to server-side pagination following the stagepage.js pattern.

Changes:
- Add SqlResource.sqlTable endpoint returning {aaData, recordsTotal,
  recordsFiltered} with DataTables server-side parameters (start,
  length, order, search)
- Rewrite allexecutionspage.js to use serverSide:true with ajax
  config pointing to the new endpoint
- Server handles sorting (id, status, description, submissionTime,
  duration), search (filters by description, status, id), and
  pagination
- Removes client-side sub-execution grouping (can be re-added as
  server-side feature later)

This scales to 50K+ SQL executions (ThriftServer/SparkConnect) without
straining the browser.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @yaooqinn .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants