Array Syntax
Closed this issue · 6 comments
Using this syntax crashes Redis, but a trivial example works. What am I missing?
This file
equivalent_identifiers|id|name|synonyms|category
['MEDDRA:10051124', 'UMLS:C0919890', 'NCIT:C113740', 'SNOMEDCT:439000005', 'HP:0011899']|HP:0011899|Hyperfibrinogenemia|[]|['phenotypic_feature', 'disease_or_phenotypic_feature', 'biological_entity', 'named_thing']
causes this error using the redislabs/redisgraph:2.2.4 Docker image.
$ redisgraph-bulk-loader test -n bulk/nodes/p.csv --separator \|
1 nodes created with label 'p'
Traceback (most recent call last):
File "/Users/scox/dev/venv/rg/bin/redisgraph-bulk-loader", line 11, in <module>
load_entry_point('redisgraph-bulk-loader==0.9.3', 'console_scripts', 'redisgraph-bulk-loader')()
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redisgraph_bulk_loader/bulk_insert.py", line 115, in bulk_insert
query_buf.send_buffer()
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redisgraph_bulk_loader/query_buffer.py", line 46, in send_buffer
result = self.client.execute_command("GRAPH.BULK", self.graphname, *args)
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redis/client.py", line 901, in execute_command
return self.parse_response(conn, command_name, **options)
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redis/client.py", line 915, in parse_response
response = connection.read_response()
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redis/connection.py", line 739, in read_response
response = self._parser.read_response()
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redis/connection.py", line 324, in read_response
raw = self._buffer.readline()
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redis/connection.py", line 256, in readline
self._read_from_socket()
File "/Users/scox/dev/venv/rg/lib/python3.7/site-packages/redis/connection.py", line 201, in _read_from_socket
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
redis.exceptions.ConnectionError: Connection closed by server.
But this file
$ cat bulk/nodes/q.csv
equivalent_identifiers|id|name|synonyms|category
ei|idx|xname|synx|catx
works.
In case this is helpful, here's the server side error message:
# redis-server --loadmodule /usr/lib/redis/modules/redisgraph.so
222:C 26 Oct 2020 20:17:57.734 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
222:C 26 Oct 2020 20:17:57.735 # Redis version=6.0.5, bits=64, commit=00000000, modified=0, pid=222, just started
222:C 26 Oct 2020 20:17:57.735 # Configuration loaded
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.0.5 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 222
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
222:M 26 Oct 2020 20:17:57.739 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
222:M 26 Oct 2020 20:17:57.739 # Server initialized
222:M 26 Oct 2020 20:17:57.741 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
222:M 26 Oct 2020 20:17:57.772 * <graph> Graph deletion will be done asynchronously.
222:M 26 Oct 2020 20:17:57.773 * <graph> Thread pool created, using 3 threads.
222:M 26 Oct 2020 20:17:57.773 * <graph> Maximum number of OpenMP threads set to 3
222:M 26 Oct 2020 20:17:57.774 * Module 'graph' loaded from /usr/lib/redis/modules/redisgraph.so
222:M 26 Oct 2020 20:17:57.814 * Ready to accept connections
redis-server: /build/src/bulk_insert/bulk_insert.c:90: _BulkInsert_ReadProperty: Assertion `0' failed.
Aborted
Hi @stevencox,
RedisGraph 2.2.4 doesn't have support for array properties; you can circumvent this problem by using the :edge Docker tag!
Hi @jeffreylovitz - perfect, that worked! There's not a flag to specify a directory or a set of files all at once, is there?
Not right now, sorry! That is a good idea, though (although you'd need separate directories for node and relationship files).
Yep, that's what I've got. Thanks for the bulk loader. Very cool.
@jeffreylovitz Roger uses the redisgraph bulk loader. Thanks for your help.