Implementation:Apache Druid RollupAnalysisPane
| Knowledge Sources | |
|---|---|
| Domains | Web_Console, SQL_Data_Loader |
| Last Updated | 2026-02-10 10:00 GMT |
Overview
A React component that analyzes dimension cardinality and relationships to help users assess rollup effectiveness during the SQL-based data loading workflow.
Description
RollupAnalysisPane is a memoized React component within the schema step of the SQL data loader view. It runs approximate count-distinct queries (using APPROX_COUNT_DISTINCT_DS_HLL) on all provided dimension expressions and their pairwise combinations to determine cardinality counts and discover implications (one dimension implying another) or equivalences (two dimensions having the same cardinality distribution). The component constructs analysis queries from a seed SQL query, casting various expression types (timestamps, arrays, general values) to strings for concatenation-based distinct counting. Results are presented as rollup ratio percentages and dimension relationship tags.
Usage
This component is used within the schema step of the SQL data loader view. It appears when the user wants to analyze how well their chosen dimensions will roll up, helping them identify redundant or equivalent dimensions before finalizing the ingestion schema.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/views/sql-data-loader-view/schema-step/rollup-analysis-pane/rollup-analysis-pane.tsx
- Lines: 1-343
Signature
export const RollupAnalysisPane = React.memo(function RollupAnalysisPane(
props: RollupAnalysisPaneProps,
): JSX.Element)
Import
import { RollupAnalysisPane } from './rollup-analysis-pane/rollup-analysis-pane';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| dimensions | readonly SqlExpression[] |
Yes | Array of SQL expressions representing the dimensions to analyze for rollup |
| seedQuery | SqlQuery |
Yes | Base SQL query to derive analysis queries from (used as the FROM clause foundation) |
| queryResult | QueryResult | undefined |
No | Previously obtained query result (used for context when available) |
| onEditColumn | (columnIndex: number) => void |
Yes | Callback invoked when the user clicks to edit a specific dimension column |
| onClose | () => void |
Yes | Callback invoked when the user closes the analysis pane |
Outputs
| Name | Type | Description |
|---|---|---|
| JSX.Element | React element | Renders a pane displaying rollup ratio (overall count / row count), per-dimension cardinality counts, and dimension implication/equivalence relationships with action buttons |
Usage Examples
Embedding in the schema step
<RollupAnalysisPane
dimensions={selectedDimensions}
seedQuery={baseQuery}
queryResult={currentResult}
onEditColumn={(index) => openColumnEditor(index)}
onClose={() => setShowAnalysis(false)}
/>