Search code examples
memgraphdb

Direct Import of gziped (.gz) files in Memgraph


My data is stored in .CSV file. I'm trying to find an efficient method for directly importing .csv.gz files.

In my current process, I'm loading these files via Python and then using the ORM. However, I'm finding this approach less efficient than I'd prefer.

Is there a native feature or perhaps a workaround in Memgraph that allows for the direct import of .tsv.gz files? Or could you suggest a more efficient way to handle this kind of data import beyond using Python and the ORM?


Solution

  • The LOAD CSV clause works well with CSV's which are compressed with gzip or bzip2.

    LOAD CSV FROM "/country.csv.gz" WITH HEADER AS row
    CREATE (c:country) SET c += row;