PGX 21.4.0
Documentation

What is New in PGX 21.4.0

PgxFrame Support in Distributed Execution Mode

PgxFrame in distributed execution mode supports the following frame operations:

  • select() and selectInPlace() to select columns from a frame
  • renameColumn() and renameColumnInPlace() to rename a single column in a frame
  • renameColumns() and renameColumnsInPlace() to rename multiple columns at once in a frame
  • union() to create a new frame containg the rows of both frames (e.g. A.union(B), where A and B are both frames having the same schema)
  • readFrame() to load a frame from a provider (currently only CSV files are supported)
  • join() to apply an EQUI-JOIN on a column

NULL Support in GROUP BY in Distributed Execution Mode

In the distributed execution mode, users can now work with null values in GROUP BY. NULL has its own group and aggregations do not count the null values.

For example, COUNT([NULL, 1, 2, NULL]) will give 2 and AVG([NULL, 2, 4, NULL]) will give 3.

For more details, see https://pgql-lang.org/spec/1.4/#null-values.

Partitioned IDs Support in Distributed Execution Mode

Graphs with partitioned IDs are now supported in distributed execution mode with the following limitations.

Improved Error Reporting for PGQL Queries in Shared-memory Execution Mode

Error reporting for PGQL queries has been improved with more precise and meaningful messages based on labels, properties and data types in the graph as well as with type signatures of the available built-in and user-defined functions.

Hereby examples of the new kinds of error messages:

SELECT COUNT(*) FROM MATCH (n:Personn)
                              ^^^^^^^
Vertex label does not exist
SELECT COUNT(*) FROM MATCH (n:Person) -[:knowws]- (m:Person)
                                         ^^^^^^
Edge label does not exist
SELECT n.naem FROM MATCH (n:Person)
         ^^^^
Property does not exist for any of the labels
SELECT SUM(n.name) FROM MATCH (n:Person)
       ^^^^^^^^^^^
The aggregate SUM is undefined for the argument type STRING
SELECT COUNT(*) FROM MATCH (n:Person) WHERE n.name > 3
                                            ^^^^^^^^^^
The operator > is undefined for the argument types STRING, LONG
SELECT n = 20 FROM MATCH (n:Person)
       ^^^^^^
The operator = is undefined for the argument types VERTEX, LONG
SELECT DATE '2000-01-01' < TIME '20:30:00+01:00' FROM MATCH (n:Person)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The operator < is undefined for the argument types DATE, TIME WITH TIME ZONE
SELECT -n.name FROM MATCH (n:Person)
       ^^^^^^^
The operator - (unary minus) is undefined for the argument type STRING
SELECT COUNT(*) FROM MATCH (n:Person) WHERE n.name
                                            ^^^^^^
WHERE clause expects a BOOLEAN expression
SELECT COUNT(*) FROM MATCH ANY CHEAPEST (n:Person) (-[e]-> (x) COST x.name)* (m:Person)
                                                                    ^^^^^^
COST clause expects a numeric expression
SELECT ID('abc') FROM MATCH (n:Person)
       ^^^^^^^^^
Function does not exist or argument types do not match
SELECT CAST(123 AS FLOAT) IN ( 'a', 'b', 'c' ) FROM MATCH (n:Person)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The IN predicate is undefined for left-hand operand type FLOAT and list value type STRING
SELECT 123 IN ( 1, 2.3, 'c' ) FROM MATCH (n:Person)
                        ^^^
Expression of a type compatible with LONG expected
SELECT SUBSTRING(DATE '2000-01-01' FROM 3 FOR 2)  FROM MATCH (n:Person)
                 ^^^^^^^^^^^^^^^^^
Character string expected
SELECT SUBSTRING('A string' FROM 3 FOR '2')  FROM MATCH (n:Person)
                                       ^^^
Numeric expected
SELECT ARRAY_AGG(n.name) FROM MATCH (n) ORDER BY ARRAY_AGG(n.name)
                                                 ^^^^^^^^^^^^^^^^^
Cannot order by ARRAY<STRING>
SELECT labels(n) FROM MATCH (n) ORDER BY labels(n)
                                         ^^^^^^^^^
Cannot order by SET<STRING>
SELECT COUNT(*) FROM MATCH (n) WHERE EXTRACT(YEAR FROM DATE '2000-01-01') OR EXTRACT(MONTH FROM DATE '2000-01-01')
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The operator OR is undefined for the argument types INTEGER, INTEGER
SELECT CASE WHEN e.amount > 1000 THEN e.amount ELSE 'x' END FROM MATCH (:Account) -[e:transaction]-> (:Account)
                                                    ^^^
Expression of a type compatible with DOUBLE expected
SELECT CASE WHEN 'a' THEN n.name ELSE 'abc' END FROM MATCH (n)
                 ^^^
BOOLEAN expression expected
SELECT ( SELECT x FROM MATCH (n:Person) GROUP BY n.name AS x ) || 20 FROM MATCH (n)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The operator || is undefined for the argument types STRING, LONG
SELECT x AS y FROM MATCH () -[e:transaction]-> () GROUP BY e.amount AS x ORDER BY y <> true
                                                                                  ^^^^^^^^^
The operator <> (or !=) is undefined for the argument types DOUBLE, BOOLEAN