Principle:Apache Druid Schema Discovery
| Knowledge Sources | |
|---|---|
| Domains | SQL_Querying, Schema_Introspection |
| Last Updated | 2026-02-10 00:00 GMT |
Overview
A metadata introspection principle that queries INFORMATION_SCHEMA tables to discover available datasources, columns, and their types for SQL query authoring.
Description
Schema Discovery provides the structural foundation for SQL query authoring by querying Druid's INFORMATION_SCHEMA system tables. This SQL-standard metadata interface exposes:
- SCHEMATA: Available schema namespaces (druid, sys, INFORMATION_SCHEMA, etc.)
- TABLES: All datasources and system tables within each schema
- COLUMNS: Column names, types, and ordinal positions for each table
The discovered schema is presented as an interactive tree (schema → table → column) that serves as both a reference and an input mechanism — clicking a table or column inserts the corresponding SQL snippet into the query editor.
Usage
Use this principle at the start of any SQL query workflow. Schema discovery runs automatically when the Workbench view loads and refreshes periodically to reflect new datasources or schema changes.
Theoretical Basis
Schema discovery follows the SQL standard INFORMATION_SCHEMA pattern:
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES
SELECT COLUMN_NAME, DATA_TYPE, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS
All queries executed via POST /druid/v2/sql
Results assembled into a hierarchical tree: Schema → Table → Column(type)
The INFORMATION_SCHEMA queries use the same SQL execution path as user queries, ensuring consistency between the metadata view and actual query capabilities.