Euno Query Language (EQL)
Euno Query Language (EQL) is a specialized query language designed for deep interaction with Euno’s data model. EQL allows users to define precise conditions to filter, retrieve, and analyze resources within Euno. Whether you're exploring relationships, tracking dependencies, or analyzing data, EQL provides the flexibility needed to extract actionable insights.
With EQL, users can:
Filter resources using specific property values.
Analyze relationships such as dependencies and hierarchies.
Query metrics, usage patterns, and other actionable data insights.
EQL’s strength lies in its ability to handle complex queries by leveraging the properties and relationships of resources within Euno’s common model. The properties of resources are derived from multiple discovery sources, including:
EQL is an essential tool for anyone seeking to unlock deep insights and harness the full potential of their data within Euno.
EQL Expressions & Operators
EQL expressions can be categorized based on the type of operation they perform. Each category allows you to query and manipulate data in different ways, using the properties defined in Euno's common model.
Logical Operations
Logical operations combine multiple conditions, allowing you to refine your query results based on the combined truth value of these conditions.
AND
OperationExpression: (
x AND y
)Meaning: Both conditions
x
andy
must be satisfied.Example:
type = 'dbt_model' AND database_schema = 'salesforce'
OR
OperationExpression: (x OR y)
Meaning: Either condition x or y must be satisfied.
Example: type = 'dbt_model' OR type = 'dbt_source'
NOT
OperationExpression:
NOT (x)
Meaning: The condition
x
must not be satisfied.Example:
NOT (type = 'looker_look')
Boolean True
Expression:
A is true
Meaning: The property
A
(of type boolean) is set totrue
.Example:
is_active is true
Boolean False
Expression:
A is false
Meaning: The property
A
(of type boolean) is set tofalse
.Example:
is_active is false
Boolean Not True
Expression:
A is not true
Meaning: The property
A
(of type boolean) is nottrue
.Example:
is_active is not true
Boolean Not False
Expression:
A is not false
Meaning: The property
A
(of type boolean) is notfalse
.Example:
is_active is not false
Boolean Not False
Expression:
A is not false
Meaning: The property
A
(of type boolean) is notfalse
.Example:
is_active is not false
Null Check
Expression:
A is null
Meaning: The property
A
is not set.Example:
last_run_time is null
Comparison Operations
Comparison operations are used to compare a property’s value with a specified value. All these operators can be used with both datetime and numeric EQL statements, with the exception of the In List Match, which cannot be used in datetime statements.
Equality
Expression:
A = 'foobar'
Meaning: The property
A
(of type text) equals'foobar'
.Example:
name = 'sales_dashboard'
Inequality
Expression:
A != 'foobar'
Meaning: The property A (of type text) is set and is not equal to 'foobar'.
Example:
status != 'archived'
Greater Than
Expression: A > 6
Meaning: The property A (of type numeric) is set and greater than 6.
Example: record_count > 1000
Greater Than or Equal To
Expression:
A >= 6
Meaning: The property
A
(of type numeric or datetime) is set and greater than or equal to6
.Example:
record_count >= 1000
Less Than
Expression:
A < 6
Meaning: The property
A
(of type numeric) is set and less than6
.Example:
record_count < 1000
Less Than or Equal To
Expression:
A <= 6
Meaning: The property
A
(of type numeric or datetime) is set and less than or equal to6
.Example:
record_count <= 1000
In List Match
Expression:
A IN [value1, value2, ...]
Meaning: The property
A
(of type numeric or string) is set and its value is one of the specified list of values.Example:
record_count IN [1000, 2000, 3000] or name IN ['sales_dashboard', 'marketing_dashboard']
Date and Time Operations
These operations compare timestamp properties against specific dates or relative time periods.
Specific Date Comparison
Expression:
A > '2023-01-01'
Meaning: The property
A
(of type timestamp) is set and the value is after2023-01-01 00:00:00
.Example:
created_at > '2023-01-01'
Relative Time Comparison
Expression:
A > -3d/h
Meaning: The property
A
(of type timestamp) is set and the value is within the last 3 days.Example:
updated_at > -7d/h (for the last 7 days/hours)
String Operations
String operations allow for querying text-based properties using conditions related to their contents.
Substring Match
Expression:
A ~ 'asdf'
Meaning: The property
A
(of type text) contains'asdf'
as a substring.Example:
description ~ 'critical'
Regular Expression Match
Expression:
A =~ 'asdf.*asdf'
Meaning: The property
A
(of type text) matches the regular expression'asdf.*asdf'
.Example:
log_entry =~ 'error.*timeout'
Map Operations
Map operations allow for checking specific keys or values within a map property.
Key Existence
Expression: 'foo' in A
Meaning: The property A (of type string map) contains the key 'foo'.
Example:
'priority' in metadata
Key-Value Match
Expression:
A.foo = 'bar'
Meaning: The property
A
is set, it has the key'foo'
, and the value of'foo'
is'bar'
.Example:
metadata.priority = 'high'
Boolean Literals
Boolean literals are static values representing true or false, often used in combination with other expressions.
True Literal
Expression: True
Meaning: Always true.
False Literal
Expression: False
Meaning: Always false.
Relationship Operations
One of the most powerful features of EQL is its ability to explore and analyze relationships between different resources. Relationships define how resources are connected within Euno’s data model, allowing users to traverse these connections and query related resources.
Upstream relationships
Expression:
has upstream(x)
Meaning: Represents resources that provide input or dependencies for another resource. For example, a dbt source might be upstream of a dbt model that uses it.
Example:
type="dbt_model" AND has upstream(type="dbt_source" AND name="foobar")
Downstream relationships
Expression:
has downstream(x)
Meaning: Represents resources that are outputs or dependents of another resource. For example, a dbt model might be downstream of a specific tableau dashboard.
Example:
type="dbt_model" and downstream(type="tableau_dashboard" and name="foobar")
Parent relationship
Expression:
has parent(x)
Meaning: Represents a hierarchical relationship where one resource contains or is the parent of another. For example, a folder containing multiple dashboards would have a parent-child relationship.
Example:
type="looker_dashboard" AND has parent(type="looker_folder and name="foobar")
Child relationship
Expression:
has child(x)
Meaning: Represents a hierarchical relationship where one resource is contained within or is a child of another. This is the inverse of the parent relationship.
Example:
type="looker_look" AND has child(type="looker_measure" AND name="foobar")
The has RELATION Operator
The has RELATION
operator in EQL allows users to filter resources based on their relationships with other resources. This operator is key to exploring complex dependencies and associations within Euno’s data model.
Expression: has RELATION((x), n)
RELATION
: The type of relationship (e.g., upstream, downstream, parent, child).x
: An EQL expression that defines the condition for the related resource.n
(optional): The maximum length of the path. If not specified, paths of any length are considered.
Example:
type = 'dbt_model' AND has upstream((type='dbt_source' AND database='test_lab_jaffle_shop'), 1)
Leveraging Relationship Operators with Boolean Logic
One of the strengths of EQL is the ability to combine relationship operators with Boolean logic to construct powerful queries. For example:
Query: type = 'looker_view' AND NOT has upstream(TRUE)
Meaning: Return all Looker views that have no upstream connections. This allows users to pinpoint resources that are isolated or not dependent on any other resource in the model.
Last updated