Skip to content

[Atscale-26533] constraint translations #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sml-reference/dimension.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ namespace Dimensions{
Boolean is_aggregatable
Boolean exclude_from_fact_agg
String time_unit
Int constraint_translation_rank
Array~String~ allowed_calcs_for_dma
CustomEmptyMember custom_empty_member
String folder
Expand Down Expand Up @@ -1188,6 +1189,14 @@ If the key consists of one column, the values in that column must be
unique. If the key is a compound key, the columns together must provide
unique values.

## constraint_translation_rank

- **Type:** integer
- **Required:** N
- **Range:** should be a valid 32 bit integer

Defines the translation of dimension filter constraints into fact table partition column constraints. This can significantly improve query performance for cases where fact-based aggregates are not used.

## shared_degenerate_columns

- **Type:** array
Expand Down
19 changes: 19 additions & 0 deletions sml-reference/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ namespace Models{
Object to
String role_play
String type
Boolean m2m
ConstraintTranslation constraint_translation
}
class From{
String dataset
Expand All @@ -228,6 +230,10 @@ namespace Models{
String level
String row_security
}
class ConstraintTranslation{
String level
Array~String~ from_columns
}
class Aggregate{
String unique_name
String label
Expand Down Expand Up @@ -395,6 +401,19 @@ marks):
For example, if you wanted to use the prefix **Order**, you would set
`role_play` to `"Order {0}"`.

### constraint_translation

- **Type:** object
- **Required:** N

Defines the translation of dimension filter constraints into fact table partition column constraints. This can significantly improve query performance for cases where fact-based aggregates are not used.

Supported properties:
- `level`: String, required. Indicates the dimension level to which the constraint translation applies.
- `from_columns`: Array, required. Lists the column(s) in the dataset that should be used for the join.

If the `constraint_translation` property is defined, a corresponding `constraint_translation_rank` must be present in the associated level.

## metrics

- **Type:** array
Expand Down