apoc.export.arrow.stream.graph

在 APOC 2025.06 版本中,此过程已被迁移至不受支持的 APOC Extended 库。这意味着如果您使用的是 APOC 2025.06 或更高版本,该过程在 Cypher 25 中不可用,但仍可与 Cypher 5 一起使用。有关更多信息,请参阅 APOC 和 Cypher 版本

此过程不建议在多线程中运行,因此并行运行时(Parallel runtime)不支持该过程。有关更多信息,请参阅 Cypher 手册 → 并行运行时

详细信息

语法

apoc.export.arrow.stream.graph(graph [, config ]) :: (value)

描述

将给定的图导出为 Arrow 字节数组。

输入参数

名称

类型

描述

graph(图)

ANY

要导出的图。

config

MAP

{ batchSize = 2000 :: INTEGER }。默认值为:{}

返回参数

名称

类型

描述

BYTEARRAY

作为字节数组的数据。

用法示例

该过程为每一批数据行暴露一个 Arrow byte[],具有以下结构 - <id>:节点 ID - <labels>:标签列表 - <source.id>:源节点 ID(如果是关系) - <target.id>:目标节点 ID(如果是关系) - <type>:关系类型 - 节点和关系的属性列表被扁平化为表格

因此,对于以下查询

CREATE (f:User {name:'Adam',age:42,male:true,kids:['Sam','Anna','Grace'], born:localdatetime('2015185T19:32:24'), place:point({latitude: 13.1, longitude: 33.46789})})-[:KNOWS {since: 1993, bffSince: duration('P5M1.5D')}]->(b:User {name:'Jim',age:42}),(c:User {age:12}),(d:Another {foo: 'bar'})

使用此查询

CALL apoc.graph.fromDB('neo4j',{}) yield graph
CALL apoc.export.arrow.stream.graph(graph)
YIELD value RETURN value"

我们将得到一个包含以下列的表格

  • <id>

  • <labels>

  • <source.id>

  • <target.id>

  • <type>

  • 名称 (name)

  • age

  • male

  • kids

  • born

  • place

  • since

  • bffSince