Chalk SQL
Query Chalk features, datasets, and connected data sources in one SQL dialect.
Chalk SQL can join data from connected databases and warehouses with data in your Chalk environment, including feature values, datasets, and resolver outputs. It also lets you call deployed Chalk Functions in SQL expressions.
In the SQL Explorer, open a worksheet and select Chalk SQL as the dialect. Run this query to check that the worksheet can execute Chalk SQL without needing any tables.
SELECT
1 AS ready;Run SHOW CATALOGS to discover the catalogs in your environment, then run
SHOW TABLES FROM chalk to find tables in the built-in chalk catalog.
Use DESCRIBE with a table name
to inspect its columns before querying it. See the
catalog guide
for ways to filter the table list.
This example joins PostgreSQL users to spending totals from BigQuery.
The catalog names my_postgres and my_bigquery refer to example integrations.
Hover over a table or column to see its catalog details. The results drawer shows the sample output.
Use catalog.schema.table to name a table or view. The first part identifies
the catalog. For example, in my_postgres.public.users, my_postgres is the
registered data source name, public is the PostgreSQL schema, and users
is the table. Quote individual identifiers when they contain spaces or literal
dots, as in chalk.historical_values."user.name".
See Available tables for examples and ways to find tables in your environment.
Chalk SQL is automatically enabled and available for use in any environment that has at least one gRPC query server running. Both new and existing environments can start running Chalk SQL queries with no additional setup.
ChalkGRPCClient.run_sql() in Python.source: chalksql in a .chalk.sql resolver
to compile its query into a feature query plan.search_sql_catalog to browse catalogs and schemas. For a table search,
set include_columns: true to see column names and Arrow types.search_docs_functions with source: "chalksql".lint_sql_query to plan your statement and check for errors without executing it.execute_sql_query to run the statement. Set preview: true to include a sample of the result.