agensgraph icon indicating copy to clipboard operation
agensgraph copied to clipboard

ERROR: invalid input syntax for type graphid: "id|creationDate|locationIP|browserUsed|content|length"

Open VinACE opened this issue 6 years ago • 4 comments

batch=# CREATE FOREIGN TABLE vlabel_profile (id graphid, properties text) batch-# SERVER import_server batch-# OPTIONS( FORMAT 'csv', HEADER 'false', FILENAME '/home/ec2-user/comments.csv', delimiter E'\t'); CREATE FOREIGN TABLE batch=# batch=# batch=# CREATE VLABEL test_vlabel; ERROR: label "test_vlabel" already exists batch=# batch=# LOAD FROM vlabel_profile AS profile_name batch-# CREATE (a:test_vlabel =to_jsonb(row_to_json(profile_name))); ERROR: invalid input syntax for type graphid: "id|creationDate|locationIP|browserUsed|content|length" CONTEXT: COPY vlabel_profile, line 1, column id: "id|creationDate|locationIP|browserUsed|content|length" batch=#

~> head comments.csv id|creationDate|locationIP|browserUsed|content|length 2473901162497|1316237219961|77.240.75.197|Firefox|yes|3 2473901162498|1316225421570|213.180.31.8|Firefox|thanks|6 4123168604165|1345407771283|41.203.141.129|Firefox|LOL|3

VinACE avatar Jul 30 '18 13:07 VinACE

Sorry I was trying the wrong insert,

CREATE VLABEL comments; the below should be a correct one LOAD FROM comments_profile AS ROW CREATE (:comments =to_jsonb(row_to_json(row)));

VinACE avatar Jul 30 '18 13:07 VinACE

The foreign table should be made in other way. Please see http://bitnine.net/documentations/quick-guide-1-3.html#graph-data-import

gtyun avatar Jul 31 '18 05:07 gtyun

Thank you for your reply, can

CREATE VLABEL comments;

LOAD FROM comments_profile AS ROW CREATE (:comments =to_jsonb(row_to_json(row)));

Is there a way to query a Normal table and form the graph nodes... or this concept is different from the multi-modal support of Agensgraph

VinACE avatar Jul 31 '18 07:07 VinACE

@VinACE , To LOAD comments.csv, try it with comments_profile.

create foreign table comments_profile ( id int8, creationDate int8, locationIP varchar(80), browserUsed varchar(80), content varchar(2000), length int4 ) server import_server options ( FORMAT 'csv', HEADER 'true', //Indicates the presence of a csv header DELIMITER '|', NULL '', FILENAME '/home/ec2-user/comments.csv' );

gtyun avatar Jul 31 '18 09:07 gtyun