-
Notifications
You must be signed in to change notification settings - Fork 22
Aliases (Spider)
[Table of Contents](https://github.com/dell-oss/Doradus/wiki/Spider Databases: Table-of-Contents) | Previous | Next
Spider Data Model: Aliases
An alias is a table-specific derived field, in which a path expression is assigned to a name that is declared in the schema. In an object query, the alias name can be used in the query or fields parameters. In an aggregate query, the alias name can be used in the query or grouping parameters. Each occurrence of an alias name is replaced by its expression text, analogous to a macro.
Alias names must begin with a ‘$’, must be at least 2 characters in length, and secondary characters can be letters, digits, or underscores (‘_’). Alias names must also be unique within the application.
Below is an example alias declaration:
<table name="Message">
<aliases>
<alias name="$SalesEmails" expression="Sender.Person.WHERE(Department:sales)"/>
<aliases>
...
</table>
Here, the alias named $SalesEmails
is assigned the expression Sender.Person.WHERE(Department:sales)
. If the following object query is submitted:
GET /Msgs/Message/_query?q=$SalesEmails.LastName:powell
The alias name $Sender
it replaced with its expression text, which causes the query to be parsed as:
GET /Msgs/Message/_query?q=Sender.Person.WHERE(Department:sales).LastName:powell
Because the expression text is expanded and evaluated in the context where it is used, alias declarations are not evaluated at schema definition time. When used in queries, an alias will generate an error if its expansion results in an invalid query.
Technical Documentation
[Doradus OLAP Databases](https://github.com/dell-oss/Doradus/wiki/Doradus OLAP Databases)
- Architecture
- OLAP Database Overview
- OLAP Data Model
- Doradus Query Language (DQL)
- OLAP Object Queries
- OLAP Aggregate Queries
- OLAP REST Commands
- Architecture
- Spider Database Overview
- Spider Data Model
- Doradus Query Language (DQL)
- Spider Object Queries
- Spider Aggregate Queries
- Spider REST Commands
- [Installing and Running Doradus](https://github.com/dell-oss/Doradus/wiki/Installing and Running Doradus)
- [Deployment Guidelines](https://github.com/dell-oss/Doradus/wiki/Deployment Guidelines)
- [Doradus Configuration and Operation](https://github.com/dell-oss/Doradus/wiki/Doradus Configuration and Operation)
- [Cassandra Configuration and Operation](https://github.com/dell-oss/Doradus/wiki/Cassandra Configuration and Operation)