Hello all/ Weibin, Can someone please help me with this query below? Say, I have a chunk size of 1024. If I have 5000 vertices in my graph, 4 chunks will be of 1024 vertices length and 5th chunk will be 904 vertices. When I try to write 5001st item, if I pass 5001 as the start vertex index to VerticeBuilder, it is overriding 904 elements with 1 element I am adding. Should I read the vertices of last chunk, add to the builder and then append back?
Thanks, Muni ________________________________ From: Muniraju Pulipalyam Sent: Monday, August 26, 2024 8:49 PM To: dev@graphar.apache.org <dev@graphar.apache.org> Subject: Re: Add a new vertex to an existing graph of vertices and edges. Thanks Weibin. This seems to work only if vertex chunk size is 1, if I want to add 1 vertex to an existing graph with vertices when I have strong validation. When chunk size is 1 it creates new file and everything works. But if chunk size is not 1 , if I enable strong validation, add vertex fails with "the start vertex index <my index number> is not aligned with chunk size" in verticesbuulder.ccline 44. If I don't enable strong validation, then last chunk file is overwritten with 1 row data, when I call dump on vertexBuilder. I tried with 10 row vertices ,chunk size 5. 11th row succeeds with new chunk created. But, if I change chunk size to 4, then I get above validation error Sent from Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: Weibin Zeng <wei...@apache.org> Sent: Monday, August 26, 2024 8:46:40 AM To: dev@graphar.apache.org <dev@graphar.apache.org> Subject: Re: Add a new vertex to an existing graph of vertices and edges. You need to specify the start vertex index when you construct the `VerticesBuilder`[1] if you want append vertices to existed graph. In your senario, the start vertex index should be 5001. [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgraphar.apache.org%2Fdocs%2Fcpp%2Fclassgraphar_1_1builder_1_1_vertices_builder.html%23a8215ee434947314027aae3a7e10dac5b&data=05%7C02%7C%7C53031b43ad4d42b99bcc08dcc57d8376%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638602390066935267%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=Eitiw5KeHMMxhYBp6LIjt28AhN32Q%2BRVtdtB2lBVvFk%3D&reserved=0<https://graphar.apache.org/docs/cpp/classgraphar_1_1builder_1_1_vertices_builder.html#a8215ee434947314027aae3a7e10dac5b> Best, Weibin Zeng On 2024/08/25 06:51:45 Muniraju Pulipalyam wrote: > I have an existing graph with 5000 vertices and 80000 edges. The vertices are > in 4 chunks. When I try to use verticesBuilder and create 5001st vertex to > add to existing collection, it is overriding existing vertex chunks. I also > tried WriteTable, but can't find a way to append. I saw samples on mid-level > and high-level writers and other samples where new files are created in /tmp > folder. I want to append a vertex to an existing vertex collection. What API > can I use to append a vertex to vertex collection and write back to file? > > Thanks. > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@graphar.apache.org For additional commands, e-mail: dev-h...@graphar.apache.org