PGX 21.1.1

PGQL Features in Distributed Execution Mode

The distributed execution mode supports Graph Pattern Matching through a subset of PGQL 1.1, PGQL 1.2 and PGQL 1.3.

Supported PGQL Features

In summary, the PGX distributed execution mode supports:

Supported Feature PGQL Version Example
Expression support (with projections, GROUP BY, ORDER BY) 1.1 SELECT 42 + AVG(m.salary) MATCH (n)->(m) GROUP BY m ORDER BY AVG(m.salary) % 10
Pattern matching -- directed or any-directed edge patterns -- with filters (and labels) 1.1 SELECT ... MATCH (a:person)-[e:likes]->(b:post) WHERE a.age > 18 AND = (directed); or
SELECT ... MATCH (a:person)-[e:follows]-(b:person) (any-directed)
Aggregations without GROUP BY 1.1 SELECT COUNT(*), MAX(a.age), AVG(a.age) MATCH (a:person)-[e:likes]->(b:post) WHERE a.age > 18
GROUP BY 1.1 SELECT a.age, AVG(a.income) ... GROUP BY a.age
ORDER BY (with LIMIT and OFFSET) 1.1 SELECT a.age, ... ORDER BY a.age
Explicit casting (CAST) 1.1 SELECT CAST(n.age AS FLOAT), CAST(n.salary AS INT), CAST('True' AS BOOLEAN), CAST(TRUE AS STRING) MATCH (n)
Distinct projections (SELECT DISTINCT) 1.1 SELECT DISTINCT n.age, n.salary MATCH (n)
IS NULL and IS NOT NULL predicates 1.1 SELECT a MATCH (a) WHERE a.address IS NULL
all_different(v1, v2, v3, ..) built-in function 1.1 SELECT a, b, c MATCH (a)->(b)-(c) WHERE all_diferent(a, b, c)
Pattern matching with IN filter expression 1.2 SELECT ... MATCH (a:person)-[e:likes]->(b:post) WHERE IN ('Emily', 'Paul', 'Juan')
Field extraction from temporal values (EXTRACT) 1.2 SELECT EXTRACT(YEAR FROM DATE '2017-02-13'), EXTRACT(SECOND FROM TIME '12:05:03.201') MATCH (n)
Numeric functions (ABS, CEIL/CEILING, FLOOR, ROUND) 1.2 SELECT ABS(-5), FLOOR(5.7), CEIL(5.2), ROUND(5.5) MATCH (n)
CASE statements 1.2 SELECT CASE WHEN 'John' THEN n.age ELSE n.income END MATCH (n)
Filtering of groups (HAVING) 1.2 SELECT a, SUM(a.income) MATCH (a) GROUP BY a HAVING SUM(a.income) > 1000
Case insensitivity for identifiers 1.3 SELECT, v.NAME FROM MATCH (u:PERSON)->(V:person)
UPDATE/INSERT/DELETE statements 1.3 UPDATE u SET (u.age = 65 - u.age) DELETE v INSERT VERTEX w LABELS(person) FROM MATCH (u)->(v)
String manipulation functions (UPPER/LOWER, SUBSTRING, || (Concatenation)) 1.3 SELECT UPPER(SUBSTRING(u.first_name FROM 1 FOR 1)) || '.' || UPPER(u.last_name) FROM MATCH (u)

Unsupported PGQL Features

The PGX distributed execution mode does not support any other PGQL 1.2 feature (also described here). Additionally, it does not support the following PGQL 1.1 features:

Unsupported Feature Example
Disconnected patterns (Cartesian product) SELECT COUNT(a) MATCH (a), (b)
Subqueries SELECT COUNT(a) MATCH (a) WHERE a.age < (SELECT AVG(b.age) MATCH (b))
Regular path queries SELECT COUNT(a) MATCH (a) -/:likes+/-> (b)
has_prop(v, prop) built-in function SELECT a MATCH (a) WHERE has_prop(a, prop)
Build-time constant expressions in combination with aggregations in projections SELECT 1 * 3 + 4, AVG(a) MATCH (a) GROUP BY a

The system will report error messages if unsupported queries are issued.