-1

Is possible to upload a json file using the COPY from a remote desktop?

Command:

crash --host 192.100.1.15:4200 -c "COPY doc.test FROM '/test.json'"

The file: {"id": 1, "name": "foo"}

Error:

SQLActionException[SQLParseException: Column reference "test.json" has too many parts. A column must not have a schema or a table here.]

Second option:

crash --host 192.100.1.15:4200 -c "COPY doc.test FROM 'file:///test.json'"

COPY OK, 0 rows affected (0.001 sec)

gtonic
  • 2,295
  • 1
  • 24
  • 32
Wk Ali
  • 21
  • 1
  • 4

1 Answers1

1

The files have to reside on the server-nodes in order to import them using COPY FROM. See COPY FROM reference docs

But there is a tool called cr8 which can be used to insert records from a JSON file: See cr8 insert-json

mfussenegger
  • 3,931
  • 23
  • 18