<p dir="auto">The attached statement does not run on Neo4j 2.3.x (tested on 2.3.8), and instead issues warnings:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING: Unknown identifier `  INTERNAL_AGGREGATE8d07c913-1eb3-4574-b62b-b2a9dddbd42c`.
Unknown identifier `  INTERNAL_AGGREGATE4ea6739e-f25a-4f19-b099-60519ff03cd1`.
Unknown identifier `  AGGREGATION498`.
Unknown identifier `billUK`.
Unknown identifier `billMobile`.
Unknown identifier `billInternational`.
Unknown identifier `  INTERNAL_AGGREGATEca8affd6-a1f2-47a3-b395-155727b9e713`.
Unknown identifier `  INTERNAL_AGGREGATEb4bf602f-803d-474e-9362-580a25153846`."><pre class="notranslate"><code class="notranslate">WARNING: Unknown identifier `  INTERNAL_AGGREGATE8d07c913-1eb3-4574-b62b-b2a9dddbd42c`.
Unknown identifier `  INTERNAL_AGGREGATE4ea6739e-f25a-4f19-b099-60519ff03cd1`.
Unknown identifier `  AGGREGATION498`.
Unknown identifier `billUK`.
Unknown identifier `billMobile`.
Unknown identifier `billInternational`.
Unknown identifier `  INTERNAL_AGGREGATEca8affd6-a1f2-47a3-b395-155727b9e713`.
Unknown identifier `  INTERNAL_AGGREGATEb4bf602f-803d-474e-9362-580a25153846`.
</code></pre></div>
<p dir="auto">The statement is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WITH &quot;2016-11&quot; AS month, &quot;November&quot; as monthName
MATCH (s:Source),(p:PhoneLine)--(so:SalesOrder)--(i:Invoiceable { state: &quot;DRAFT&quot;})
WHERE s.src = p.msisdn
WITH month, monthName, so, s, i, so.phone_callingPlan = &quot;PAYT&quot; AS billUK, NOT     HAS(so.boltOns_mobile) AS billMobile, NOT HAS(so.boltOns_international) AS billInternational
WITH month, monthName, so, s, i, billUK, billMobile, billInternational
MATCH (s)--(c:Call)--(ch:Charge)--(t:Tariff)
WHERE c.start STARTS WITH month
WITH monthName, s, i, t.type AS type, COUNT(c) AS calls, SUM(ch.total) AS chargePence, SUM(c.billsec) AS seconds, ROUND(10 * SUM(TOFLOAT(c.billsec))/60)/10 AS minutes, CASE
WHEN t.type = &quot;UK Landline&quot; AND NOT billUK THEN FALSE
WHEN t.type = &quot;UK Mobile&quot; AND NOT billMobile THEN FALSE
WHEN t.type = &quot;International&quot; AND NOT billInternational THEN FALSE
ELSE true
END AS chargeable
WITH monthName, s, i, type, calls, CASE chargeable WHEN TRUE THEN chargePence ELSE 0 END AS chargePence, seconds, minutes
WITH monthName, type, i, &quot;0&quot; + RIGHT(s.src, SIZE(s.src) - 2) + &quot;: &quot; + calls + &quot; calls, lasting &quot; + minutes + &quot; minutes.&quot; as desc, chargePence / 100 AS charge
CREATE (i)-[:HAS_LINEITEM]-&gt;(item:LineItem:_LineItem { title: &quot;Phone Calls: &quot; + type + &quot; (&quot; + monthName + &quot;)&quot; })
SET item.id = 101
SET item.price = charge
SET item.description = desc
SET item.frequency = &quot;MONTHLY&quot;
SET item.type = &quot;TELEPHONY&quot;
RETURN item;"><pre class="notranslate"><code class="notranslate">WITH "2016-11" AS month, "November" as monthName
MATCH (s:Source),(p:PhoneLine)--(so:SalesOrder)--(i:Invoiceable { state: "DRAFT"})
WHERE s.src = p.msisdn
WITH month, monthName, so, s, i, so.phone_callingPlan = "PAYT" AS billUK, NOT     HAS(so.boltOns_mobile) AS billMobile, NOT HAS(so.boltOns_international) AS billInternational
WITH month, monthName, so, s, i, billUK, billMobile, billInternational
MATCH (s)--(c:Call)--(ch:Charge)--(t:Tariff)
WHERE c.start STARTS WITH month
WITH monthName, s, i, t.type AS type, COUNT(c) AS calls, SUM(ch.total) AS chargePence, SUM(c.billsec) AS seconds, ROUND(10 * SUM(TOFLOAT(c.billsec))/60)/10 AS minutes, CASE
WHEN t.type = "UK Landline" AND NOT billUK THEN FALSE
WHEN t.type = "UK Mobile" AND NOT billMobile THEN FALSE
WHEN t.type = "International" AND NOT billInternational THEN FALSE
ELSE true
END AS chargeable
WITH monthName, s, i, type, calls, CASE chargeable WHEN TRUE THEN chargePence ELSE 0 END AS chargePence, seconds, minutes
WITH monthName, type, i, "0" + RIGHT(s.src, SIZE(s.src) - 2) + ": " + calls + " calls, lasting " + minutes + " minutes." as desc, chargePence / 100 AS charge
CREATE (i)-[:HAS_LINEITEM]-&gt;(item:LineItem:_LineItem { title: "Phone Calls: " + type + " (" + monthName + ")" })
SET item.id = 101
SET item.price = charge
SET item.description = desc
SET item.frequency = "MONTHLY"
SET item.type = "TELEPHONY"
RETURN item;
</code></pre></div>
<p dir="auto">It does issues the same warning when run with PROFILE, and emits no profile information.</p>
<p dir="auto">When I remove the second WITH:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    WITH month, monthName, so, s, i, so.phone_callingPlan = &quot;PAYT&quot; AS billUK, NOT     HAS(so.boltOns_mobile) AS billMobile, NOT HAS(so.boltOns_international) AS billInternational
    WITH month, monthName, so, s, i, billUK, billMobile, billInternational"><pre class="notranslate"><code class="notranslate">    WITH month, monthName, so, s, i, so.phone_callingPlan = "PAYT" AS billUK, NOT     HAS(so.boltOns_mobile) AS billMobile, NOT HAS(so.boltOns_international) AS billInternational
    WITH month, monthName, so, s, i, billUK, billMobile, billInternational
</code></pre></div>
<p dir="auto">The statement runs fine.</p>
<p dir="auto">Is this a bug?</p>
<ul dir="auto">
<li>docker: 3.5.11</li>
<li>API/Driver: import tool</li>
<li><strong>Steps to reproduce</strong></li>
</ul>
<p dir="auto">import a csv like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="my:ID(MyNode),:IGNORE
x ,y
x,y"><pre class="notranslate"><code class="notranslate">my:ID(MyNode),:IGNORE
x ,y
x,y
</code></pre></div>
<ul dir="auto">
<li>Expected behavior</li>
</ul>
<p dir="auto">Two nodes, <code class="notranslate">MyNode {my: 'x '}</code> and <code class="notranslate">MyNode {my: 'x'}</code>.</p>
<ul dir="auto">
<li>Actual behavior</li>
</ul>
<p dir="auto">Import error for duplicate nodes <code class="notranslate">'x'</code></p>
<ul dir="auto">
<li>Discussion</li>
</ul>
<p dir="auto">The implicit <code class="notranslate">.strip()</code> is problematic in entity resolution, finger printing, etc. use cases as we want the delta. The current behavior is not documented, and the warning is super tough to debug (giving the id, vs. 2 conflicting line numbers). Cleaning up outside of neo4j is likewise inherently tricky: you can see folks online discussing running <code class="notranslate">| sort -u</code> to trim to unique before sending to neo4j, except getting that to work with <code class="notranslate">""</code> and <code class="notranslate">\s</code> adds even more fun that most solutions won't get into because it's not easy.</p>
<p dir="auto">Working around by quoting ID columns seems to cause other issues for Neo4j, maybe because there is no character requiring the quote, so the quotes are treated as part of the full IDs? Unclear -- we had issues and gave up.</p>