Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with $value parameter in Neo4j Sink Connector with Confluent Cloud Kafka #568

Open
tgod009 opened this issue Jun 29, 2023 · 2 comments

Comments

@tgod009
Copy link

tgod009 commented Jun 29, 2023

I'm experiencing an issue with the Neo4j Sink Connector when used with the latest version of Confluent Cloud Kafka. It seems like the connector is not correctly understanding or processing the $value parameter.

Here are the details of my setup:

  • Neo4j version: 5.9
  • Neo4j Streams (Kafka Connector) version: [latest version]
  • Kafka version (Confluent Cloud): [latest version]

I've tried just about every possible way of writing this query but still seems to fail

WITH $value.user AS user CREATE (u:User {name: user.name})

Any guidance or assistance with this issue would be greatly appreciated. Thank you.

@TomVanWemmel
Copy link

It should be event without a parameter reference ($).
The connector polls a bunch of Kafka messages (default 500), splits this into batches (configured with neo4j.batch.size) and creates a transaction per batch.

As it states in the documentation:

Under the hood the Sink inject the event object in this way

UNWIND $batch AS event
MERGE (p:Person{name: event.name, surname: event.surname})
MERGE (f:Family{name: event.surname})
MERGE (p)-[:BELONGS_TO]->(f)

So don't use any parameter value, but you can use the local variable event directly

@ali-ince
Copy link
Contributor

@tgod009 did you get it working by following @TomVanWemmel's suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants