////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The Neo4j Generate CSV transform writes files for nodes and relationships to the import folder for use with Neo4j's neo4j-import tool.

= image:transforms/icons/neo4j_load.svg[Neo4j Generate CSVs transform Icon, role="image-doc-icon"] Neo4j Generate CSVs

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The Neo4j Generate CSV transform writes files for nodes and relationships to the import folder for use with Neo4j's neo4j-import tool.

|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:question_mark.svg[Maybe Supported, 24]
!Flink! image:question_mark.svg[Maybe Supported, 24]
!Dataflow! image:question_mark.svg[Maybe Supported, 24]
!===
|===

== Options

[options="header"]
|===
|Option|Default|Description
|Transform name|Neo4j Generate CSVs|
|Graph field|-|The field in this pipeline that contains the graph data (Graph data type)
|Base folder (below `import/` folder)|`/var/lib/neo4j`|the folder to write the nodes and relationships types to
|CSV files prefix|prefix|prefix to apply to the generated CSV files
|Node/Relationships Uniqueness strategy|None|

* None: don't handle uniqueness while generating CSVs
* First: if duplicates are found, keep the first occurrence
* Last: if duplicates are found, keep the last occurrence

Please note that primary key of all nodes written to a CSV file needs to be unique.
The uniqueness strategy used in this transform is simple in nature and loads everything in memory.
Because of this you can consider using a Sort transform to force uniqueness beforehand.

|Filename field|filename|field that contains the filename for the CSV files to be generated
|File type field|fileType|field that contains the file type for the CSV files to be generated
|===