Replies: 3 comments 2 replies
-
Will there be any other advantages of this in terms of usability, functionality?
In SQL, Is this similar to a |
Beta Was this translation helpful? Give feedback.
-
If there is another column Will |
Beta Was this translation helpful? Give feedback.
-
@aklish a few comments:
|
Beta Was this translation helpful? Give feedback.
-
Overview
Parameterized metrics (and later dimensions and tables) will require a number of changes to HJSON, exported metadata, and the behavior of the API.
API Changes
The RSQL filter dialect will support parameters in the filter predicate's left hand side. RSQL allows square braces ('[' and ']') along with semicolons in the left hand side allowing the following new syntax:
columnName[argName1:argValue1][arg2Name:argValue2]
For example, the following paramterized filters will be valid:
HJSON Changes
Example Configuration
The following example configuration file includes:
Templating
Column & Join Definition Templates
The handlebars context will be initialized with the logical table that is being queried along with contextual object that store additional information. The handlebars context will have the following fields:
Contextual Objects
User Object
Represents the client principal.
Request Object
Represents the client request.
Tables Object
Represents the static list of available tables in the semantic layer.
Column Object
Represents the current column that is being expanded.
Invoking a Parameterized Column
The 'sql' handlerbars helper can expand any logical column, parameterized logical column, or physical column to its corresponding SQL:
Time Grain Templates
Instead of leveraging the expression '{{}}', time grain templates will be expanded with handlebars using the same scheme described above.
Parameterized Columns that reference other Parameterized Metrics
When defining a parameterized column that references another parameterized column, all parameters required to expand the column definition must be defined in the HJSON (there are no implicit or inherited parameters). This has a number of advantages with respect to parameter overrides:
Overriding the type of a parameter is forbidden and will result in an error during configuration processing.
Reserved parameters
Some parameter names ('grain' for time dimensions for example) are reserved by Elide. Elide should prevent these from being defined in the HJSON files.
API Restrictions
Elide will throw an HTTP client error in the following situations:
Metadata Model Changes
Existing FunctionArgument Model
Recommended FunctionArgument Model
Repurpose MetricFunction
Change
MetricFunction
toFunction
and allow both metrics, dimensions, and tables to have them.Beta Was this translation helpful? Give feedback.
All reactions