neo4j 使用apoc.periodic. png拆分字符串

vuv7lop3  于 2023-10-18  发布在  其他
关注(0)|答案(2)|浏览(144)

我在Neo4j中包含一个在apoc.periodic.cloud中拆分字符串的函数时遇到了错误。也就是说,这是我运行良好的查询:

WITH collect(file.URL) AS fileURLs
UNWIND fileURLs AS fileURL
CALL apoc.periodic.iterate(
'
CALL apoc.load.csv($url) YIELD map AS csv
RETURN csv
',
'
WITH round(toFloat(csv.dendrogram_height),3,"HALF_UP") as height, csv.gene_name as gene, csv.event_no as event, csv.samples as sp, round(toFloat(csv.median_ge),3,"HALF_UP") as me, csv.no_of_samples as no_s, csv.leaf_status as leaf, csv.patients as pts, csv.no_of_uniq_patients as no_pt, round((toFloat(csv.log2fc)),3,"HALF_UP") as log2, round(toFloat(csv.padj_deseq2),3,"HALF_UP") as padj, csv.up_or_down as up
CREATE (:Expression:Primary {name: gene, event_no: event, dendrogram_height: height, samples: sp, median_exp: me, no_of_samples: no_s, leaf_status: leaf, patients: pts, no_of_unique_patients: no_pt, log2fc: log2, padj_deseq2: padj, up_or_down: up});
',
{batchSize:10000,parallel:true,params:{url:fileURL}}) YIELD batches, total
RETURN batches, total;

但是当我在WITH语句中包含函数split(或apoc.text.split)时,即,

MATCH (file:File) WITH file
WITH collect(file.URL) AS fileURLs
UNWIND fileURLs AS fileURL
CALL apoc.periodic.iterate(
'
CALL apoc.load.csv($url) YIELD map AS csv
RETURN csv
',
'
WITH round(toFloat(csv.dendrogram_height),3,"HALF_UP") as height, csv.gene_name as gene, csv.event_no as event, csv.samples as sp, round(toFloat(csv.median_ge),3,"HALF_UP") as me, csv.no_of_samples as no_s, csv.leaf_status as leaf, split(csv.patients,',') as pts, csv.no_of_uniq_patients as no_pt, round((toFloat(csv.log2fc)),3,"HALF_UP") as log2, round(toFloat(csv.padj_deseq2),3,"HALF_UP") as padj, csv.up_or_down as up
CREATE (:Expression:Primary {name: gene, event_no: event, dendrogram_height: height, samples: sp, median_exp: me, no_of_samples: no_s, leaf_status: leaf, patients: pts, no_of_unique_patients: no_pt, log2fc: log2, padj_deseq2: padj, up_or_down: up});
',
{batchSize:10000,parallel:true,params:{url:fileURL}}) YIELD batches, total
RETURN batches, total;

我得到一个错误说:

Procedure call provides too many arguments: got 4 expected no more than 3.

Procedure apoc.periodic.iterate has signature: apoc.periodic.iterate(cypherIterate :: STRING?, cypherAction :: STRING?, config :: MAP?) :: batches :: INTEGER?, total :: INTEGER?, timeTaken :: INTEGER?, committedOperations :: INTEGER?, failedOperations :: INTEGER?, failedBatches :: INTEGER?, retries :: INTEGER?, errorMessages :: MAP?, batch :: MAP?, operations :: MAP?, wasTerminated :: BOOLEAN?, failedParams :: MAP?, updateStatistics :: MAP?
meaning that it expects at least 3 arguments of types STRING?, STRING?, MAP?
Description: Runs the second statement for each item returned by the first statement.
This procedure returns the number of batches and the total number of processed rows. (line 4, column 1 (offset: 90))
"CALL apoc.periodic.iterate("
 ^

唯一的区别是split(csv.patients,',')中的split函数与第二个查询块中的csv.patients函数。
如何解决这一问题?谢谢.

lc8prwob

lc8prwob1#

在分裂中,彗发周围的单引号扰乱了周期性振荡的3个字符串的打开和关闭
使用双引号,你应该很好...

bzzcjhmw

bzzcjhmw2#

这需要一个双引号来表示split函数。即,将(csv.患者,",”)拆分为pts

相关问题