You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#1796: procedure/function to provide an URL + indexed String or json object (#4375) (#4390)
* Fixes#1796: procedure/function to provide an URL + indexed String or json object (#4375)
* Fixes#1796: procedure/function to provide an URL + indexed String or json object
* added docs, performance test compared with csv
* restored gitmodule stuff and added azure test
* fix tests
* added docs
* cleanup
* fix test
* ignored flaky test
* Update ExportExtendedSecurityTest.java
| compression | Enum[NONE, GZIP, BZIP2, DEFLATE, BLOCK_LZ4, FRAMED_SNAPPY] | NONE | Set the compression algorithm used, in case of a byte array reading.
32
+
|===
33
+
34
+
35
+
== Usage examples
36
+
37
+
We can read a portion of a string from a local file URL, a remote URL (i.e. http(s)/gcp/S3/Azure/Hdfs), a local/remote file placed in an archive, or a byte array.
38
+
It's useful compared to other load procedures since the access into the file is handled more efficiently, not an openStream and a read to location.
39
+
40
+
That is:
41
+
42
+
- in case of a local file under-the-hood an https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/RandomAccessFile.html[RandomAccessFile] will be created.
43
+
- in case of http(s) URL we will put an additional HTTP header `Range: bytes=<offset>`, while in case of limit set it will be `Range: bytes=<offset>-<httpLimit>`, where httpLimit is equal to `offset + limit - 1`.
44
+
- in case of S3 location, an https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/model/GetObjectRequest.html#range()[GetObjectRequest.range()] will be used.
45
+
- in the other cases, we will execute an https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html#skip-long-[InputStream.skip()]
Or also from a byte array, optionally setting the compression type (default 'NONE', that is not compressed), for example using the `apoc.util.compress` (placed in APOC Core):
105
+
106
+
[source,cypher]
107
+
----
108
+
WITH apoc.util.compress('testFooBar', {compression: 'DEFLATE'}) AS compressed
109
+
CALL apoc.load.stringPartial(compressed, 5, 17, {compression: 'DEFLATE'}) YIELD value RETURN value
0 commit comments