Chalk SQL
Query named datasets, feature observations, resolver output, and online store values.
Use these views in the chalk catalog to read your features and datasets from SQL.
chalk.datasets schemaThe chalk.datasets schema contains a view for each named dataset created within the last 60 days,
and the view’s name is the dataset’s name. Note that if two offline queries reference the same named dataset,
only the latest dataset revision is available in this schema.
To reference dataset revisions that are not the most
recent or were created without a name, consider using the get_dataset_revision() table-valued function.
chalk.historical_values schemaThe chalk.historical_values schema contains a view for each feature, as well as a view for each feature namespace
within the deployment.
Query the view named for the fully qualified feature, such as chalk.historical_values."user.name", to read all observations of that feature.
| Column | Type | Description |
|---|---|---|
observation_id | string (non-nullable) | Unique identifier for the observation. |
pkey | Primary key type (non-nullable) | Primary key associated with the observation. |
value | Feature type | Observed value of the feature. |
value_json | string | Deprecated. Observed value as JSON, retained for backwards compatibility. |
observed_at | timestamp (non-nullable) | Time when the feature value was observed. |
inserted_at | timestamp (non-nullable) | Time when the feature value was inserted into the offline store. |
resolver_fqn | string (nullable) | Fully qualified name of the resolver that computed the feature. |
deployment_id | string (nullable) | ID of the deployment where the observation was made. |
operation_kind | int8 (nullable) | Kind of operation that produced the observation. |
operation_id | string (nullable) | ID of the query operation that produced the observation. |
Query the view named for the feature namespace, such as chalk.historical_values.user, to read the latest observed value of each feature for each primary key.
| Column | Type | Description |
|---|---|---|
__pkey__ | Primary key type (non-nullable) | Primary key associated with the row. |
feature_name | Feature type | Latest observed value for the feature and primary key. Each feature has a column named for it. |
feature_name.__observed_at__ | timestamp | Time when that feature’s latest value was observed. |
This schema is available in Chalk deployments with an offline store configured.
chalk.resolvers schemaThe chalk.resolvers schema contains a view for each dataframe-returning resolver that
takes in no inputs. When querying this view, a resolver run will be triggered and have the resolver’s outputs as the
view’s contents.
chalk.online_store schemaThe information in chalk.online_store.keys depends on which online store your environment uses.
| Online store | Information available |
|---|---|
| Redis | Key type (such as Scalar, HasMany, or TimeSeries), memory usage, TTL, and fully qualified feature name. |
| DynamoDB | Key namespace and value. |
Each feature namespace has a view with the same name, such as chalk.online_store.user.
| Column | Description |
|---|---|
__id__ | Primary key for the row. |
namespace.feature_name | Stored value for the feature. Each feature has a column named for it. |
namespace.feature_name_ts | Timestamp for the stored feature value. |