Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
stylecircle

...

Result of this query will be next:

Text view
nameroles
title
"Meg Ryan"["DeDe", "Angelica Graynamore", "Patricia Graynamore"]"Joe Versus the Volcano"
"Meg Ryan"["Sally Albright"]"When Harry Met Sally"
"Meg Ryan"["Kathleen Kelly"]"You've Got Mail"
"Meg Ryan"["Carole"]"Top Gun"
"Meg Ryan"["Annie Reed"]"Sleepless in Seattle"

Source Splitter

The proposal is to add "Splits Number" Source configuration property, which allows specifying the desired number of splits to divide the query into when reading from Neo4j. 
Fewer splits may be created if the query cannot be divided into the desired number of splits.
Also, we can use '0' as the default value for this configuration property and determine the number of splits according to the number of map tasks (controlled by the "mapreduce.job.maps" property):

...

SectionUser Facing NameWidget TypeDescriptionConstraints
GeneralLabeltextboxLabel for UI.

Reference NametextboxUniquely identified name for lineage.Required

Neo4j Host
textboxNeo4j database host.Required

Neo4j PortnumberNeo4j database port.Required

Input Querytextbox

The query to use to import data from the Neo4j database.
Query example: 'MATCH (n:Label) RETURN n.property_1, n.property_2'.

Required
CredentialsUsernametextboxUser identity for connecting to the Neo4j.Required

PasswordpasswordPassword to use to connect to the Neo4j.Required
AdvancedSplits NumbernumberThe number of splits to generate. If set to one, the orderBy is not needed.

Order Bytextbox

Field Name which will be used for ordering during splits generation. This is required unless numSplits is set to one.


...

SectionUser Facing NameWidget TypeDescriptionConstraints
GeneralLabeltextboxLabel for UI.

Reference NametextboxUniquely identified name for lineage.Required

Neo4j HosttextboxNeo4j database host.Required

Neo4j PortnumberNeo4j database port.Required

Output Querytextbox

The query to use to export data to the Neo4j database.
Query example: 'CREATE (n:<label_field> $(property_1, property_2))' or
'CREATE (n:<label_field> $(*))'

Required
CredentialsUsernametextboxUser identity for connecting to the Neo4j.Required

PasswordpasswordPassword to use to connect to the Neo4j.Required

...

To solve these problems, the following solution was proposed:
Using next structure $(...) for identify place where properties will be inserted.
Example of using $(...):
List of output fields: ["name", "age", "profesion", "company", "rating", "position"]

Output queryExpected results
CREATE (n:Node $(*))Will be created node with label Node and properties ["name", "age", "profesion", "company", "rating", "position"]
CREATE (p:Person $(name, age, profesion)), (c:Company $(company, rating))Will be created node with label Person and properties ["name", "age", "profesion"]
Will be created node with label Companyand properties ["company", "rating"]
CREATE (p:Person $(name, profesion))-[r:WorkOn $(position)]->(c:Company $(company))Will be created node with label Person and properties ["name", "profesion"]
Will be created relation with type WorkOn and properties ["position"]
Will be created node with label Companyand properties ["company"]

Sink Data Types Mapping

CDAP Schema Data TypesNeo4j Data Types
nullnull
arrayList
booleanBoolean
longInteger
doubleFloat
stringString
bytesByteArray
dateDate
time-microsTime
timestamp-microsDateTime

Duration

Point

...