trino icon indicating copy to clipboard operation
trino copied to clipboard

[WIP] Neo4j connector

Open ragnard opened this issue 1 year ago • 6 comments

Description

Connector for the Neo4j graph database.

Additional context and related issues

See docs for connector overview.

Release notes

[ ] This is not user-visible or is docs only, and no release notes are required. [ ] Release notes are required. Please propose a release note for me. [x] Release notes are required, with the following suggested text:

# Neo4j connector
* New connector supporting the Neo4j graph database

ragnard avatar Sep 25 '23 19:09 ragnard

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

cla-bot[bot] avatar Sep 25 '23 19:09 cla-bot[bot]

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

cla-bot[bot] avatar Sep 26 '23 18:09 cla-bot[bot]

I'd appreciate an initial review of this. The connector is working as intended.

For tests I've mostly tried to cover the type mappings for the table function, which should cover all types, and the same for the node/relationship tables (although more test cases need to be added here).

ragnard avatar Oct 08 '23 19:10 ragnard

What are your thoughts on implementing "dynamic tables", like the Pinot connector does?

It would be easy to support queries like:

select * from "match (a:Actor)-[c:ACTED_IN]-(m:Movie) return a, c, m";

ie. the table name is a CQL query.

This would be the similar to functionality provided by the system.query table function that I have currently implemented. Since Neo4j is dynamically typed there is no way to know the structure of the result. For the table function the user can optionally provide a DESCRIPTOR for typing the return result, if not, a generic JSON-result is returned (single column of type json named result). For a dynamic table like the above, we could do the same, so the result would be:

result (json)
{"a": {...}, "c": {...}, "m": {...}}

ragnard avatar Oct 18 '23 12:10 ragnard

That approach is now discouraged. We used it before we had support for table functions, but it's no longer necessary.

martint avatar Oct 18 '23 13:10 martint

That approach is now discouraged. We used it before we had support for table functions, but it's no longer necessary.

Ok, thanks, then I'll stick to the table function.

ragnard avatar Oct 18 '23 14:10 ragnard