Documentssuperset
Table Chart Data Export
Table Chart Data Export
Type
Topic
Status
Published
Created
Jul 8, 2026
Updated
Jul 8, 2026
Created by
Dosu Bot
Updated by
Dosu Bot

Table Chart Data Export#

Apache Superset's Table chart supports exporting data to CSV, Excel (XLSX), and JSON. The export path diverges depending on whether the chart uses client-side pagination (default) or server-side pagination, and whether the export is triggered from the dashboard UI or a scheduled report.


Row Limit Configuration#

Four config variables in superset/config.py govern how many rows are returned:

VariableDefaultPurpose
ROW_LIMIT50,000Default row limit for chart data queries
SQL_MAX_ROW100,000Hard cap for non-server-paginated table queries
TABLE_VIZ_MAX_ROW_SERVER500,000Hard cap when server-side pagination is enabled
ALLOW_FULL_CSV_EXPORT (feature flag)FalseEnables "Export to full .CSV / Excel" menu items in dashboard

The backend enforces these caps in apply_max_row_limit() (superset/utils/core.py). When server_pagination=True the limit is capped at TABLE_VIZ_MAX_ROW_SERVER; otherwise it is capped at SQL_MAX_ROW. A limit of 0 is treated as "use the max" .


Frontend Query Construction (buildQuery.ts)#

buildQuery.ts in superset-frontend/plugins/plugin-chart-table/src/ is the single source of truth for how query parameters are assembled before being sent to the backend.

Download path (result_format is csv, xlsx, or JSON-results): the query sets row_limit from formData.row_limit and resets row_offset to 0 .

Server-pagination preview path (not a download): the query uses ownState.pageSize (falling back to server_page_length) for row_limit and derives row_offset from the current page . A separate is_rowcount: true query is also emitted so the table knows total row count .


Known Bugs & Recent Fixes#

Frontend: row limit not respected with server pagination (merged June 2026)#

PR #41024 fixed a bug where server-paginated previews ignored row_limit. Previously the last page of a row_limit=120, server_page_length=50 chart would still request 50 rows, returning up to 150 rows total. The fix:

  • Computes lastPage from row_limit / pageSize and clamps currentPage to it.
  • Caps each page's row_limit to the remaining rows within the configured row_limit (so the last page only requests the remainder).
  • Resets to full first-page row_limit on filter-change, without corrupting the stored pageSize in ownState.

Scheduled report exports: wrong row limit used (merged July 2026)#

PR #41103 fixed scheduled CSV/XLSX report exports for server-paginated Table charts. The report worker was sending the saved query context from the preview path, which carried row_limit = server_page_length instead of row_limit = form_data.row_limit, and included a superfluous is_rowcount query.

The fix (in superset/commands/report/execute.py) adds _get_chart_data_request_payload(), which:

  1. Reads the saved query_context from the chart model.
  2. When form_data["server_pagination"] is set, overwrites the first data query's row_limit from form_data["row_limit"] and resets row_offset to 0.
  3. Strips any is_rowcount query from the payload.
  4. POSTs to the chart data API (ChartDataRestApi.data) with result_format=CSV/XLSX and result_type=post-processed.

This change is scoped to the report worker and does not alter the public chart data API contract .


ALLOW_FULL_CSV_EXPORT Feature Flag#

When enabled, the dashboard header for Table charts gains two extra menu items — "Export to full .CSV" and "Export to full Excel" — gated by both the feature flag and the can_csv permission . This flag is False by default because an unrestricted export can exhaust server memory or compute .

The flag is listed as "In Testing" in the feature flags documentation.


Key Source Files#

FileRole
superset/config.pyAll row limit and feature flag defaults
superset/utils/core.pyapply_max_row_limit()Backend row-limit enforcement
plugin-chart-table/src/buildQuery.tsFrontend query construction (download vs. preview logic)
superset/commands/report/execute.pyScheduled report export execution
SliceHeaderControls/index.tsxDashboard "full export" menu items gated by ALLOW_FULL_CSV_EXPORT