Skip to content

Commit 340e88b

Browse files
committed
Script improvements
1 parent 117239f commit 340e88b

File tree

3 files changed

+241
-135
lines changed

3 files changed

+241
-135
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,34 @@ https://oss.redislabs.com/redisgraph/
1313
## Usage
1414
bulk_insert.py GRAPHNAME [OPTIONS]
1515

16-
| Flags | Extended flags | Parameter |
17-
|---------|-----------------------|----------------------------------------------|
18-
| -h | --host TEXT | Redis server host (default: 127.0.0.1) |
19-
| -p | --port INTEGER | Redis server port (default: 6379) |
20-
| -a | --password TEXT | Redis server password |
21-
| -c | --ssl_certfile TEXT | path to certfile for SSL connection |
22-
| -k | --ssl_keyfile TEXT | path to keyfile for SSL connection |
23-
| -n | --nodes TEXT | path to node csv file [required] |
24-
| -r | --relationships TEXT | path to relationship csv file |
16+
| Flags | Extended flags | Parameter |
17+
|---------|-----------------------|-----------------------------------------------------------------|
18+
| -h | --host TEXT | Redis server host (default: 127.0.0.1) |
19+
| -p | --port INTEGER | Redis server port (default: 6379) |
20+
| -a | --password TEXT | Redis server password |
21+
| -n | --nodes TEXT | path to node csv file [required] |
22+
| -r | --relations TEXT | path to relationship csv file |
23+
| -t | --max-token-count INT | max number of tokens sent in each Redis query (default 1024) |
24+
| -b | --max-buffer-size INT | max batch size (MBs) of each Redis query (default 4096) |
25+
| -c | --max-token-size INT | max size (MBs) of each token sent to Redis (default 500) |
26+
2527

2628
The only required arguments are the name to give the newly-created graph (which can appear anywhere) and at least one node CSV file.
2729
The nodes and relationship flags should be specified once per input file.
2830

31+
The flags for `max-token-count`, `max-buffer-size`, and `max-token-size` should only be specified if the memory overhead of graph creation is too high. The bulk loader builds large graphs by sending binary tokens (each of which holds multiple nodes or relations) to Redis in batches. By lowering these limits from their defaults, the size of each transmission to Redis is lowered and fewer entities are held in memory, at the expense of a longer overall runtime.
32+
2933
```
3034
python bulk_insert.py GRAPH_DEMO -n example/Person.csv -n example/Country.csv -r example/KNOWS.csv -r example/VISITED.csv
3135
```
32-
The label (for nodes) or relationship type (for relationships) is derived from the base name of the input CSV file. In this query, we'll construct two sets of nodes, labeled `Person` and `Country`, and two types of relationships - `KNOWS` and `VISITED`.
36+
The label (for nodes) or relationship type (for relationships) is derived from the base name of the input CSV file. In this example, we'll construct two sets of nodes, labeled `Person` and `Country`, and two types of relationships - `KNOWS` and `VISITED`.
3337

3438
## Input constraints
3539
### Node identifiers
3640
- If both nodes and relations are being created, each node must be associated with a unique identifier.
3741
- The identifier is the first column of each label CSV file. If this column's name starts with an underscore (`_`), the identifier is internal to the bulk loader operation and does not appear in the resulting graph. Otherwise, it is treated as a node property.
42+
- Each identifier must be entirely unique across all label files.
3843
- Source and destination nodes in relation CSV files should be referred to by their identifiers.
39-
- The name of the identifier columns otherwise do not matter, so long as no node has a duplicated value.
4044
- The uniqueness restriction is lifted if only nodes are being created.
4145

4246
### Entity properties
@@ -52,7 +56,7 @@ The label (for nodes) or relationship type (for relationships) is derived from t
5256
- Each row must have the same number of fields.
5357
- Leading and trailing whitespace is ignored.
5458
- The first field of a label file will be the node identifier, as described in [Node Identifiers](#node-identifiers).
55-
- With the possible exception of the first, each field in the header is a property key. The value in that position for each node is the property associated with that key.
59+
- All fields are property keys that will be associated with each node.
5660

5761
### Relationship files
5862
- Each row must have the same number of fields.

0 commit comments

Comments
 (0)