英文:
Error while loading edges from CSV file in Apache-AGE, Errors says: Label_id must be 1 .. 65535
问题
I am using this query to load edges from a CSV file in agload_test_graph, this graph is already being created.
SELECT load_edges_from_file('agload_test_graph', 'has_city',
'/home/kamleshk/age_installation/age-viewer/sample/DIRECTED[person&movie].csv');
The content of the CSV files is:
But it return error: Label_id must be 1 .. 65535
What mistake Am I doing?
英文:
I am using this query to load edges from a CSV file in agload_test_graph, this graph is already being created.
SELECT load_edges_from_file('agload_test_graph', 'has_city',
'/home/kamleshk/age_installation/age-viewer/sample/DIRECTED[person&movie].csv');
The content of the CSV files is:
But it return error: Label_id must be 1 .. 65535
What mistake Am I doing?
答案1
得分: 1
你需要提供起始节点和结束节点的ID,格式如下:
起始ID, 起始节点类型, 结束ID, 结束节点类型
153 , 城市 , 3 , 国家
确保你已经先创建了这些节点。示例文件可以在这里查看。
英文:
You need to provide the IDs of both the start and end nodes, like this:
start_id, start_vertex_type, end_id, end_vertex_type
153 , City , 3 , Country
Make sure you've created the nodes first. Example files can be viewed here
答案2
得分: 0
这个错误是因为标签尚未创建,而您尝试在函数load_edges_from_file
内部使用该标签。这个函数的工作方式是,您需要传递一个已经创建的标签,因为它在内部使用与标签相关联的label_id
(只有在标签创建后才会分配一个序列号给标签),如果标签不存在,那么在函数中label_id
将被设置为0,这就是出现此错误的地方。
> 错误:label_id 必须在1到65535之间
所以,修复方法是:
SELECT create_elabel('agload_test_graph','has_city');
SELECT load_edges_from_file('agload_test_graph', 'has_city', 'age_load/data/edges.csv');
参考链接:
agload文档
英文:
This error occurs when the label has not yet been created and you try to use the label inside the function load_edges_from_file
. The way this function works is that you need to pass a label that has already been created because internally it uses the label_id
associated with a label (a sequence number will be given to a label only when it has been created) and if the label does not exist, then the label_id is set to 0
in the function and that is where this error occurs
> ERROR: label_id must be 1 .. 65535
So, a fix would be
SELECT create_elabel('agload_test_graph','has_city');
SELECT load_edges_from_file('agload_test_graph', 'has_city',
'age_load/data/edges.csv');
Reference:
agload documentation
答案3
得分: 0
您的标签在使用之前尚未创建,因此如前面的回复中所提到的,重要的是在将其作为参数发送到方法load_edged_from_file之前生成标签。如果您还为起始节点和结束节点提供ID,也将很有益处。
英文:
Your label has not been created before it is being used so, as mentioned in the responses above, it is important to generate the label before sending it as an argument to the method load_edged_from_file. It will also be beneficial if you provide IDs for the start and finish nodes.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论