Closed farhadnowzari closed 3 weeks ago
I updated to 5.0.5
and now the error changed to: For Schema.Type.STRUCT we support only Map and Point
Hi @farhadnowzari, I tested with version 5.0.5 and got the expected result. Could you please provide the whole query?
And I recommend you to use confluentinc/cp-server-connect:7.3.0
container image for connect if you don't have a dependency on the current one.
Hi @farhadnowzari, I tested with version 5.0.5 and got the expected result. Could you please provide the whole query? And I recommend you to use
confluentinc/cp-server-connect:7.3.0
container image for connect if you don't have a dependency on the current one.
So I did the update to cp-server-connect:7.3.0
, but I still get the error. The data which I'm trying to send, I have attached with the message.
it works, if I return the location
like this in the neo4j query:
location{
.id,
.name,
addressLine: COALESCE(location.addressLine, null),
postalCode: COALESCE(location.postalCode, null),
city: COALESCE(location.city, null),
country: COALESCE(location.country, null),
phoneNumber: COALESCE(location.phoneNumber, null)
} as location,
Looks like there is a bug, when query returns object list and if the first element of the list has a null value, like the example below;
{
"name": "Movie#1",
"resources": [
{
"name": null,
"isUsed": false
},
{
"name": "Light",
"isUsed": true
}
]
}
if so, it's not able to correctly determine schema for the data.
For now, as workaround solution you can either remove "neo4j.enforce.schema": "true"
property from configuration but in this case, value schema will be String type or provide a not null default value for each property which is returning from query by using COALESCE.
Another solution would be to use latest connector version which is 5.1.0-rc02 but you will need to do small migration on the configuration.
This is the public repo for the latest version of connector; https://github.com/neo4j/neo4j-kafka-connector
I'm closing this issue as it is no longer reproducible in the latest version. Please feel free to reopen it if the problem occurs again.
Expected Behavior (Mandatory)
We have a cypher, where at the end will generate an output like this, if it is ran against neo4j:
if the resources objects have a value of type boolean or integer, the connector fails after reading one node into the topic and it complains with such error
Invalid Java object for schema with type STRING: class java.lang.Long
We are using the neo4j-connector version 5.0.2 against neo4j 5.19 with
confluentinc/cp-kafka-connect-base:6.2.1
Actual Behavior (Mandatory)
The objects inside an array should have their types kept and not be converted to String, because neo4j cypher is going to return boolean or long or any other type which cannot be casted to STRING.
How to Reproduce the Problem
The actual query is much bigger, but the following one kinda give the idea how our case look like.
Steps (Mandatory)
Specifications (Mandatory)
The schema registry service from kafka is not deployed.
Versions
Stacktrace