title: “Views” weight: 10 type: docs aliases:
A view is a logical table that encapsulates business logic and domain-specific semantics. While most compute engines support views natively, each engine stores view metadata in proprietary formats, creating interoperability challenges across different platforms. Paimon views abstracting engine-specific query dialects and establishing unified metadata standards. View metadata could enable centralized view management that facilitates cross-engine sharing and reduces maintenance complexity in heterogeneous computing environments.
View metadata is persisted only when the catalog implementation supports it:
File-system catalogs do not currently support views because they lack persistent metadata storage.
| Field | Type | Description |
|---|---|---|
query | string | Canonical SQL SELECT statement that defines the view. |
dialect | string | SQL dialect identifier (for example, spark or flink). |
Multiple representations can be stored for the same version so that different engines can access the view using their native dialect.
Use CREATE VIEW or CREATE OR REPLACE VIEW to register a view. Paimon assigns a UUID, writes the first metadata file, and records version 1.
CREATE VIEW sales_view AS SELECT region, SUM(amount) AS total_amount FROM sales GROUP BY region;
Paimon provides the sys.alter_view_dialect procedure so that engines can manage multiple SQL representations for the same view version.
-- Add a Flink dialect CALL [catalog.]sys.alter_view_dialect('view_identifier', 'add', 'flink', 'SELECT ...'); -- Update the stored Flink dialect CALL [catalog.]sys.alter_view_dialect('view_identifier', 'update', 'flink', 'SELECT ...'); -- Drop the Flink dialect representation CALL [catalog.]sys.alter_view_dialect('view_identifier', 'drop', 'flink');
-- Add a Spark dialect CALL sys.alter_view_dialect('view_identifier', 'add', 'spark', 'SELECT ...'); -- Update the Spark dialect CALL sys.alter_view_dialect('view_identifier', 'update', 'spark', 'SELECT ...'); -- Drop the Spark dialect CALL sys.alter_view_dialect('view_identifier', 'drop', 'spark');
DROP VIEW view_name;