Re: SQL Property Graph Queries (SQL/PGQ)
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix some typos and make small stylistic improvements
- 5282bf535e47 19 (unreleased) landed
-
Cleanup users and roles in graph_table_rls test
- 040a56be4bcc 19 (unreleased) landed
-
Dump labels in reproducible order
- c9babbc8816a 19 (unreleased) landed
-
SQL Property Graph Queries (SQL/PGQ)
- 2f094e7ac691 19 (unreleased) landed
-
Factor out constructSetOpTargetlist() from transformSetOperationTree()
- 8c2b30487cc7 19 (unreleased) landed
-
Sort out table_open vs. relation_open in rewriter
- d537f59fbbfc 19 (unreleased) landed
-
Rename grammar nonterminal to simplify reuse
- 8080f44f96a9 19 (unreleased) landed
-
Make ecpg parse.pl more robust with braces
- 7f88553ceaca 19 (unreleased) landed
-
Don't lock partitions pruned by initial pruning
- 525392d5727f 18.0 cited
-
Remove pg_regex_collation
- 792b2c7e6d92 18.0 cited
-
Use auxv to check for CRC32 instructions on ARM.
- aac831cafa6f 18.0 cited
-
Fix inappropriate uses of atol()
- f5a1311fccd2 18.0 cited
-
Remove unnecessary array object_classes[] in dependency.c
- ef5e2e90859a 17.0 cited
Attachments
- 0004-Fix-spurious-column-not-found-error-20240805.patch (text/x-patch) patch 0004
- 0003-Fix-compilation-error-20240805.patch (text/x-patch) patch 0003
- 0005-support-WHERE-clause-in-graph-pattern-20240805.patch (text/x-patch) patch 0005
- 0002-pgperltidy-fixes-20240805.patch (text/x-patch) patch 0002
- 0001-WIP-SQL-Property-Graph-Queries-SQL-PGQ-20240805.patch (text/x-patch) patch 0001
- 0006-Support-cyclic-path-pattern-20240805.patch (text/x-patch) patch 0006
On Mon, Jul 22, 2024 at 5:31 PM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote: > I found that the patches do not support cyclic paths correctly. A cyclic path pattern is a path patterns where an element pattern variable repeats e.g. (a)->(b)->(a). In such a path pattern the element patterns with the same variable indicate the same element in the path. In the given example (a) specifies that the path should start and end with the same vertex. Patch 0006 supports cyclic path patterns. Elements which share the variable name should have the same element type. The element patterns sharing the same variable name should have same label expression. They may be constrained by different conditions which are finally ANDed since they all represent the same element. The patch creates a separate abstraction "path_factor" which combines all the GraphElementPatterns into one element pattern. SQL/PGQ standard uses path_factor for such an entity, so I chose that as the structure name. But suggestions are welcome. A path_factor is further expanded into a list of path_element objects each representing a vertex or edge table that satisfies the label expression in GraphElementPattern. In the previous patch set, the consecutive elements were considered to be connected to each other. Cyclic paths change that. For example, in path pattern (a)->(b)->(a), (b) is connected to the first element on both sides (forming a cycle) instead of first and third element. Patch 0006 has code changes to appropriately link the elements. As a side effect, I have eliminated the confusion between variables with name gep and gpe. While it's easy to imagine a repeated vertex pattern, a repeated edge pattern is slightly complex. An edge connects only two vertices, and thus a repeated edge pattern constrains the adjacent vertex patterns even if they have different variable names. Such patterns are not supported. E.g. (a)-[b]->(c)-[b]->(d) would mean that (d) and (a) represent the same vertex even if the variable names are different. Such patterns are not supported for now. But (a)-[b]->(a)-[b]->(a) OR (a)-[b]->(c)<-[b]-(a) are supported since the vertices adjacent to repeated edges are constrained by the variable name anyway. The patch also changes many foreach() to use foreach_* macros as appropriate. > 0001 - same as previous one > 0002 - fixes pgperltidy complaints > 0003 - fixes compilation failure > 0004 - fixes issue seen on CI > 0005 - adds support for WHERE clause in graph pattern missing in the > first patch. 0006 - adds full support for cyclic path patterns Once reviewed, patches 0002 to 0006 should be merged into 0001. -- Best Wishes, Ashutosh Bapat