IMPORT from local file system

is it possible to run IMPORT against local non-cloud/remote file system? Example running it from my MAC:

js.execute(“IMPORT TABLE foo_drop (” +
" id TEXT, " +
“) " +
" CSV DATA /Users/akosgey/Dev/crdbtest/foo.csv”);

All the examples on the site only shows cloud/remote storage, ultimately I would like to copy the CSV from HDFS, is that possible?

Yes, it is possible to do so.

Assuming you’re running cockroach on your mac (for development purposes, etc), you can specify a --external-io-dir command line argument. See for flag documentation.

Assuming you start cockroach with something like:
./cockroach start-single-node --insecure --external-io-dir=/Users/akosgey/Dev/crdbtest
you could then run your import command:
“IMPORT TABLE … CSV DATA (‘nodelocal:///foo.csv’)”
(Note: you have to put the list of the imported files inside ‘()’ and each path must be quoted…)

You can also use this as a guide on how to use nodelocal.

This gives more information about importing local files.

Thank you for the reply. My question was actually pushing local files to a remote CRDB installation, sorry if that was not clear. Hence the idea is more for a JDBC client running anywhere outside of CRDB, and running IMPORT from local to remote CRDB.

@akosgey, use the guide @mattvardi provided step 3, you can spin up a quick webserver to host your local files and use that from any CRDB environment.