LogoLogo
Start Trial
  • Overview
    • What is DeltaStream?
    • Core Concepts
      • Access Control
      • Region
      • SQL
      • Store
      • Database
      • Query
      • Visualizing Data Lineage
      • Function
  • Getting Started
    • Free Trial Quick Start
    • Starting with the Web App
    • Starting with the CLI
  • Tutorials
    • Managing Users and User Roles
      • Inviting Users to an Organization
      • Administering Users in your Organization
      • Using the CLI to Manage User Roles
      • Example: Setting Up Custom Roles for Production and Stage
    • Creating Stores for Streaming Data
    • Using Multiple Stores in Queries
    • Creating Relations to Structure Raw Data
    • Namespacing with Database and Schema
    • Creating and Querying Materialized Views
    • Creating a Function
    • Securing Your Connections to Data Stores
      • Introducing DeltaStream Private Links
      • Creating an AWS Private Link from DeltaStream to your Confluent Kafka Dedicated Cluster
      • Enabling Private Link Connectivity to Confluent Enterprise Cluster and Schema Registry
      • Creating a Private Link from DeltaStream to Amazon MSK
      • Creating a Private Link for RDS Databases
      • Deleting a Private Link
    • Integrations
      • Connecting to Confluent Cloud
      • Databricks
      • PostgreSQL
      • Snowflake
      • WarpStream
    • Serialization
      • Working with ProtoBuf Serialized Data and DeltaStream Descriptors
      • Working with Avro Serialized Data and Schema Registries
      • Configuring Deserialization Error Handling
  • Reference
    • Enterprise Security Integrations
      • Okta SAML Integration
      • Okta SCIM Integration
    • Metrics
      • Prometheus Integration
      • Built-In Metrics
      • Custom Metrics in Functions
    • SQL Syntax
      • Data Formats (Serialization)
        • Serializing with JSON
        • Serializing with Primitive Data Types
        • Serializing with Protobuf
      • Data Types
      • Identifiers and Keywords
      • Command
        • ACCEPT INVITATION
        • CAN I
        • COPY DESCRIPTOR_SOURCE
        • COPY FUNCTION_SOURCE
        • DESCRIBE ENTITY
        • DESCRIBE QUERY
        • DESCRIBE QUERY METRICS
        • DESCRIBE QUERY EVENTS
        • DESCRIBE QUERY STATE
        • DESCRIBE RELATION
        • DESCRIBE RELATION COLUMNS
        • DESCRIBE ROLE
        • DESCRIBE SECURITY INTEGRATION
        • DESCRIBE <statement>
        • DESCRIBE STORE
        • DESCRIBE USER
        • GENERATE COLUMNS
        • GENERATE TEMPLATE
        • GRANT OWNERSHIP
        • GRANT PRIVILEGES
        • GRANT ROLE
        • INVITE USER
        • LIST API_TOKENS
        • LIST DATABASES
        • LIST DESCRIPTORS
        • LIST DESCRIPTOR_SOURCES
        • LIST ENTITIES
        • LIST FUNCTIONS
        • LIST FUNCTION_SOURCES
        • LIST INVITATIONS
        • LIST METRICS INTEGRATIONS
        • LIST ORGANIZATIONS
        • LIST QUERIES
        • LIST REGIONS
        • LIST RELATIONS
        • LIST ROLES
        • LIST SCHEMAS
        • LIST SCHEMA_REGISTRIES
        • LIST SECRETS
        • LIST SECURITY INTEGRATIONS
        • LIST STORES
        • LIST USERS
        • PRINT ENTITY
        • REJECT INVITATION
        • REVOKE INVITATION
        • REVOKE PRIVILEGES
        • REVOKE ROLE
        • SET DEFAULT
        • USE
      • DDL
        • ALTER API_TOKEN
        • ALTER SECURITY INTEGRATION
        • CREATE API_TOKEN
        • CREATE CHANGELOG
        • CREATE DATABASE
        • CREATE DESCRIPTOR_SOURCE
        • CREATE ENTITY
        • CREATE FUNCTION_SOURCE
        • CREATE FUNCTION
        • CREATE INDEX
        • CREATE METRICS INTEGRATION
        • CREATE ORGANIZATION
        • CREATE ROLE
        • CREATE SCHEMA_REGISTRY
        • CREATE SCHEMA
        • CREATE SECRET
        • CREATE SECURITY INTEGRATION
        • CREATE STORE
        • CREATE STREAM
        • CREATE TABLE
        • DROP API_TOKEN
        • DROP CHANGELOG
        • DROP DATABASE
        • DROP DESCRIPTOR_SOURCE
        • DROP ENTITY
        • DROP FUNCTION_SOURCE
        • DROP FUNCTION
        • DROP METRICS INTEGRATION
        • DROP RELATION
        • DROP ROLE
        • DROP SCHEMA
        • DROP SCHEMA_REGISTRY
        • DROP SECRET
        • DROP SECURITY INTEGRATION
        • DROP STORE
        • DROP STREAM
        • DROP USER
        • UPDATE ENTITY
        • UPDATE SCHEMA_REGISTRY
        • UPDATE SECRET
        • UPDATE STORE
      • Query
        • APPLICATION
        • Change Data Capture (CDC)
        • CREATE CHANGELOG AS SELECT
        • CREATE STREAM AS SELECT
        • CREATE TABLE AS SELECT
        • Function
          • Built-in Functions
          • Row Metadata Functions
        • INSERT INTO
        • Materialized View
          • CREATE MATERIALIZED VIEW AS
          • SELECT (FROM MATERIALIZED VIEW)
        • Query Name and Version
        • Resume Query
        • RESTART QUERY
        • SELECT
          • FROM
          • JOIN
          • MATCH_RECOGNIZE
          • WITH (Common Table Expression)
        • TERMINATE QUERY
      • Sandbox
        • START SANDBOX
        • DESCRIBE SANDBOX
        • STOP SANDBOX
      • Row Key Definition
    • Rest API
Powered by GitBook
On this page
  • Syntax
  • Description
  • Arguments
  • Examples
  1. Reference
  2. SQL Syntax
  3. Command

LIST RELATIONS

PreviousLIST REGIONSNextLIST ROLES

Last updated 5 months ago

Syntax

[ LIST | SHOW ] [ RELATIONS | STREAMS | CHANGELOGS | MATERIALIZED VIEWS ]
[ IN SCHEMA schema_name ];

Description

This command provides a list of (s) defined in a . You can also use this command to filter further, based on relation types.

Relations are listed only if the current role has USAGE privileges on the database and schema and SELECT or INSERT privilege on the relation.

Arguments

IN SCHEMA schema_name

Optionally, this specifies the schema name for which the relations should be listed. Provide a fully-qualified schema name of the form <database_name>.<schema_name>. The system uses the current database and schema as the default for this command.

Examples

List all relations in the default schema

The following provides a list of all relations that are in the scope of a user’s account and default schema (demodb.public):

demodb.public/demostore# LIST RELATIONS;
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
|  Name         |  Type     |  Owner   |  State  |  Properties                              |  Created At                   |  Updated At                   |
+===============+===========+==========+=========+==========================================+===============================+===============================+
| keyed_pv      | stream    | sysadmin | created | { "value.format": "json",                | 2024-07-12 20:43:54 +0000 UTC | 2024-07-12 20:43:54 +0000 UTC |
|               |           |          |         | "topic.partitions": 1, "key.type":       |                               |                               |
|               |           |          |         | "STRUCT\u003cuserid VARCHAR\u003e",      |                               |                               |
|               |           |          |         | "topic": "ds_pageviews", "store":        |                               |                               |
|               |           |          |         | "pub_demo_msk", "key.format": "json",    |                               |                               |
|               |           |          |         | "topic.replicas": 3 }                    |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
| mviewstream   | materiali | sysadmin | created | { "key.type": "STRUCT\u003c\"pageid\"    | 2024-06-25 22:08:25 +0000 UTC | 2024-06-25 22:08:27 +0000 UTC |
|               | zed_view  |          |         | VARCHAR\u003e", "primary.key": "pageid"  |                               |                               |
|               |           |          |         | }                                        |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
| pv            | stream    | sysadmin | created | { "value.format": "json", "topic":       | 2024-03-19 03:29:03 +0000 UTC | 2024-03-19 03:29:04 +0000 UTC |
|               |           |          |         | "ds_pageviews", "store": "pub_demo_msk"  |                               |                               |
|               |           |          |         | }                                        |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
| pv_avro       | stream    | sysadmin | created | { "value.format": "avro", "key.type":    | 2024-06-11 19:47:20 +0000 UTC | 2024-06-11 19:47:21 +0000 UTC |
|               |           |          |         | "STRUCT\u003cuserid VARCHAR\u003e",      |                               |                               |
|               |           |          |         | "topic": "pageviews_avro", "store":      |                               |                               |
|               |           |          |         | "kafka_with_sr", "key.format": "avro" }  |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
| users_log     | changelog | sysadmin | created | { "value.format": "json", "key.type":    | 2024-05-01 20:01:44 +0000 UTC | 2024-05-01 20:01:45 +0000 UTC |
|               |           |          |         | "STRUCT\u003cuserid VARCHAR\u003e",      |                               |                               |
|               |           |          |         | "topic": "ds_users", "store":            |                               |                               |
|               |           |          |         | "pub_demo_msk", "primary.key":           |                               |                               |
|               |           |          |         | "userid", "key.format": "json" }         |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
| dbx_pv        | table     | sysadmin | errored | { "table.data.file.location":            | 2024-07-01 22:41:56 +0000 UTC | 2024-07-01 22:42:12 +0000 UTC |
|               |           |          |         | "s3://deltastream-ctan-databricks-bucket |                               |                               |
|               |           |          |         | /new_catalog/new_schema/pageviews",      |                               |                               |
|               |           |          |         | "databricks.catalog.name":               |                               |                               |
|               |           |          |         | "new_catalog", "databricks.table.name":  |                               |                               |
|               |           |          |         | "pageviews", "databricks.schema.name":   |                               |                               |
|               |           |          |         | "new_schema", "store":                   |                               |                               |
|               |           |          |         | "test_databricks_store" }                |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+

List all relations in a specific schema

The following provides a list of relations within the testdb.analytics schema regardless of the default schema:

demodb.public/demostore# LIST RELATIONS IN SCHEMA testdb.analytics;
main_db.public/pub_demo_msk# LIST RELATIONS;
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
|  Name         |  Type     |  Owner   |  State  |  Properties                              |  Created At                   |  Updated At                   |
+===============+===========+==========+=========+==========================================+===============================+===============================+
| total_views   | changelog | sysadmin | created | { "key.type": "STRUCT\u003c\"pageid\"    | 2023-02-10 21:48:25 +0000 UTC | 2023-02-25 22:08:27 +0000 UTC |
|               |           |          |         | VARCHAR\u003e", "primary.key": "pageid"  |                               |                               |
|               |           |          |         | }                                        |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+

List all streams in the default schema

demodb.public/demostore# LIST STREAMS;
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
|  Name         |  Type     |  Owner   |  State  |  Properties                              |  Created At                   |  Updated At                   |
+===============+===========+==========+=========+==========================================+===============================+===============================+
| keyed_pv      | stream    | sysadmin | created | { "value.format": "json",                | 2024-07-12 20:43:54 +0000 UTC | 2024-07-12 20:43:54 +0000 UTC |
|               |           |          |         | "topic.partitions": 1, "key.type":       |                               |                               |
|               |           |          |         | "STRUCT\u003cuserid VARCHAR\u003e",      |                               |                               |
|               |           |          |         | "topic": "ds_pageviews", "store":        |                               |                               |
|               |           |          |         | "pub_demo_msk", "key.format": "json",    |                               |                               |
|               |           |          |         | "topic.replicas": 3 }                    |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
| pv            | stream    | sysadmin | created | { "value.format": "json", "topic":       | 2024-03-19 03:29:03 +0000 UTC | 2024-03-19 03:29:04 +0000 UTC |
|               |           |          |         | "ds_pageviews", "store": "pub_demo_msk"  |                               |                               |
|               |           |          |         | }                                        |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
| pv_avro       | stream    | sysadmin | created | { "value.format": "avro", "key.type":    | 2024-06-11 19:47:20 +0000 UTC | 2024-06-11 19:47:21 +0000 UTC |
|               |           |          |         | "STRUCT\u003cuserid VARCHAR\u003e",      |                               |                               |
|               |           |          |         | "topic": "pageviews_avro", "store":      |                               |                               |
|               |           |          |         | "kafka_with_sr", "key.format": "avro" }  |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+

List all shangelogs in the default schema

demodb.public/demostore# LIST CHANGELOGS;
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
|  Name         |  Type     |  Owner   |  State  |  Properties                              |  Created At                   |  Updated At                   |
+===============+===========+==========+=========+==========================================+===============================+===============================+
| users_log     | changelog | sysadmin | created | { "value.format": "json", "key.type":    | 2024-05-01 20:01:44 +0000 UTC | 2024-05-01 20:01:45 +0000 UTC |
|               |           |          |         | "STRUCT\u003cuserid VARCHAR\u003e",      |                               |                               |
|               |           |          |         | "topic": "ds_users", "store":            |                               |                               |
|               |           |          |         | "pub_demo_msk", "primary.key":           |                               |                               |
|               |           |          |         | "userid", "key.format": "json" }         |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+

List all materialized views in the default schema

demodb.public/demostore# LIST MATERIALIZED VIEWS;
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
|  Name         |  Type     |  Owner   |  State  |  Properties                              |  Created At                   |  Updated At                   |
+===============+===========+==========+=========+==========================================+===============================+===============================+
| mviewstream   | materiali | sysadmin | created | { "key.type": "STRUCT\u003c\"pageid\"    | 2024-06-25 22:08:25 +0000 UTC | 2024-06-25 22:08:27 +0000 UTC |
|               | zed_view  |          |         | VARCHAR\u003e", "primary.key": "pageid"  |                               |                               |
|               |           |          |         | }                                        |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+

List all tables in the default schema

demodb.public/demostore# LIST TABLES;
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+
|  Name         |  Type     |  Owner   |  State  |  Properties                              |  Created At                   |  Updated At                   |
+===============+===========+==========+=========+==========================================+===============================+===============================+
| dbx_pv        | table     | sysadmin | errored | { "table.data.file.location":            | 2024-07-01 22:41:56 +0000 UTC | 2024-07-01 22:42:12 +0000 UTC |
|               |           |          |         | "s3://deltastream-ctan-databricks-bucket |                               |                               |
|               |           |          |         | /new_catalog/new_schema/pageviews",      |                               |                               |
|               |           |          |         | "databricks.catalog.name":               |                               |                               |
|               |           |          |         | "new_catalog", "databricks.table.name":  |                               |                               |
|               |           |          |         | "pageviews", "databricks.schema.name":   |                               |                               |
|               |           |          |         | "new_schema", "store":                   |                               |                               |
|               |           |          |         | "test_databricks_store" }                |                               |                               |
+---------------+-----------+----------+---------+------------------------------------------+-------------------------------+-------------------------------+

The following provides a list of all within the scope of a user’s account and default schema:

The following provides a list of all within the scope of a user’s account and default schema:

The following provides a list of all within the scope of a user’s account and default schema:

The following provides a list of all within the scope of a user’s account and default schema:

database’s
relation
schema
streams
changelogs
materialized views
tables