OS: Windows Server 2019 Datacenter
Java 1.8.0_292
neo4j-jdbc-driver-4.0.4
Pentaho Data Integration 9.2
OLD version: community 4.2.13 (problem/error DOES NOT arise)
(attempt) New Version: community 4.4.2
I also tested, and the problem is also in neo4j 4.3.x
The error DOES NOT OCCUR in the neo4j browser, only when I attempt to run a job through PDI (using the neo4j jdbc driver)
The error does NOT OCCUR using the SAME jdbc driver with the older version of neo4j
PDI Transform fails with:
This feature is deprecated and will be removed in future versions. (WARNING)
Neo.ClientNotification.Statement.FeatureDeprecationWarning : Coercion of list to boolean is deprecated. Please consider using NOT isEmpty(...)
instead
I believe THIS is the statement it is complaining about:
where split(c.email,'@')[1]=~domainname and
not (domainname in publicdomains) and not (domainname in cemaildomains)
I did some searching, and tried some alternatives... Every option I tried complained that I was trying to ask things of a list, but was providing a boolean.
The original error claims I'm trying to coerce a list INTO a boolean, so I feel like I'm caught in a circular logic problem here.
Here's some of the alternatives I tried (that also failed:)
//not all(x in publicdomains WHERE x=domainname) and not all(x in cemaildomains WHERE x=domainname)
//isEmpty(domainname in publicdomains) AND isEmpty(domainname in cemaildomains)
Here's the entire query (basically trying to identify NON-public email domains, that ONLY are associated with ONE client in our CRM - essentially determining email domains that are likely unique to a particular client and then creating a relationship to :Clientdomain):
// Creating (:Clientdomain)-[:DOMAIN_OF]-(:Company) relationships for accounts that exclusively use the domain (from Contacts).
MATCH (cd:Clientdomain)-[]-(:Company)
WITH COLLECT(distinct cd.name) as cemaildomains
MATCH (c:Contact)-[:ACCOUNT_STATE]-(:Recordstatus {state:'A'})
WHERE c.email IS NOT NULL
WITH cemaildomains,collect(distinct split(c.email,"@")[1]) as emaildomains,
['gmail.com','yahoo.com','hotmail.com','aol.com','hotmail.co.uk','msn.com','comcast.net','live.com','rediffmail.com','ymail.com','outlook.com','cox.net','sbcglobal.net','verizon.net','googlemail.com','rocketmail.com','att.net','facebook.com','usinternet.com','charter.net','sky.com','earthlink.net','inbox.com','icloud.com','mail.com','qq.com','me.com','mail.com','frontiernet.net','juno.com','windstream.net','mac.com','attlocal.net','zyxel.com','airstreamcomm.net','example.com'] as publicdomains
UNWIND emaildomains as domainname
MATCH (c:Contact)-[:WORKS_FOR]-(a:Company)
where split(c.email,'@')[1]=~domainname and
not (domainname in publicdomains) and not (domainname in cemaildomains)
with domainname,collect(distinct a.name) as colcomp
MATCH (a:Company {name:colcomp[0]})
where size(colcomp)=1
MERGE (cd:Clientdomain {name:trim(domainname)})
WITH * WHERE not (cd)-[]-(:Company)
MERGE (cd)-[:DOMAIN_OF]->(a)
RETURN distinct domainname,a.name order by a.name
;