Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Apache Druid NumberMenuItems

From Leeroopedia
Revision as of 14:15, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Apache_Druid_NumberMenuItems.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Web_Console, Query_Workbench
Last Updated 2026-02-10 10:00 GMT

Overview

NumberMenuItems is a React component that renders context menu items for numeric columns in the workbench column tree.

Description

The component provides a set of menu items specifically tailored for numeric column operations within the SQL query workbench. It offers filter operations (greater than / less than or equal to 9000), group by options (raw and truncated), and aggregate functions (SUM, MIN, MAX, AVG, COUNT DISTINCT, APPROX_QUANTILE, LATEST). Each menu action programmatically modifies the current parsed SQL query and triggers the onQueryChange callback.

Usage

Used within the column tree context menu when the user right-clicks on a numeric column in the workbench view's schema browser. The component is rendered as a set of BlueprintJS MenuItem elements that modify the active SQL query.

Code Reference

Source Location

Signature

export interface NumberMenuItemsProps {
  table: string;
  schema: string;
  columnName: string;
  parsedQuery: SqlQuery;
  onQueryChange: (query: SqlQuery, run?: boolean) => void;
}

export const NumberMenuItems = React.memo(function NumberMenuItems(props: NumberMenuItemsProps): JSX.Element;

Import

import { NumberMenuItems } from 'web-console/src/views/workbench-view/column-tree/column-tree-menu/number-menu-items/number-menu-items';

I/O Contract

Inputs

Name Type Required Description
table string Yes The table name the column belongs to
schema string Yes The schema name the column belongs to
columnName string Yes The name of the numeric column
parsedQuery SqlQuery Yes The current parsed SQL query to modify
onQueryChange (query: SqlQuery, run?: boolean) => void Yes Callback invoked when a menu item modifies the query

Outputs

Name Type Description
JSX.Element React Fragment A fragment containing Filter, Remove filter, Group by, Remove group by, and Aggregate menu items

Usage Examples

Rendering number menu items for a column

<NumberMenuItems
  table="my_table"
  schema="druid"
  columnName="revenue"
  parsedQuery={currentParsedQuery}
  onQueryChange={(newQuery, shouldRun) => {
    setQuery(newQuery);
    if (shouldRun) runQuery();
  }}
/>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment