GraphScope icon indicating copy to clipboard operation
GraphScope copied to clipboard

Return graph rather than context if context type is `vertex_data`

Open siyuan0322 opened this issue 2 years ago • 0 comments

  • When the app context type is vertex_data context, do an add_column operation and return the new graph
  • fix projected graph

Here's the demo, note that the person label has a property named result, which is created automatically by add_column. Also note that we use the ret to run app again, this time the previous property result will be replaced by new result, as they have different property id.

>>> pg = g.project(vertices={'person': []}, edges={'knows': []})
>>>
>>> ret = graphscope.wcc(pg)
I0314 15:57:17.000000 15536 /home/graphscope/graphscope/analytical_engine/core/grape_instance.cc:215] Projecting graph, dst graph name: graph_WXIIwo7J, type sig: fa138b06dfa9775adceb4b872f8948a2b1a75fd00dfdb8e862efe6c440d325bd
2022-03-14 15:57:17,422 [INFO][utils:166]: Codegened graph type: gs::ArrowProjectedFragment<int64_t,uint64_t,grape::EmptyType,grape::EmptyType>, Graph header: core/fragment/arrow_projected_fragment.h
I0314 15:57:17.000000 15536 /home/graphscope/graphscope/analytical_engine/core/grape_instance.cc:175] Loading application, application name: app_Q2RQ0DRJ , library path: /tmp/gs/builtin/c001c8e71058544b5719e7fca5fa9cb367be126c57f872f6440826f245b345ee/libc001c8e71058544b5719e7fca5fa9cb367be126c57f872f6440826f245b345ee.so
I0314 15:57:17.000000 15536 /usr/local/include/grape/worker/worker.h:105] [Coordinator]: Finished PEval
I0314 15:57:17.000000 15536 /usr/local/include/grape/worker/worker.h:120] [Coordinator]: Finished IncEval - 1
>>> print(ret.schema)
oid_type: LONG
vid_type: ULONG
type: VERTEX
Label: person
Properties: Property(3, result, LONG)

type: EDGE
Label: knows
Properties:
Relations: [Relation(source='person', destination='person')]
>>> ret2 = graphscope.wcc(ret)
/home/graphscope/graphscope/analytical_engine/core/grape_instance.cc:175] Loading application, application name: app_b7mtKLHI , library path: /tmp/gs/builtin/1f883425f647470b93d187a5e4fc100241ad08bb3bde8b99664c81537dc61823/lib1f883425f647470b93d187a5e4fc100241ad08bb3bde8b99664c81537dc61823.so
I0315 10:10:55.000000 38672 /usr/local/include/grape/worker/worker.h:105] [Coordinator]: Finished PEval
I0315 10:10:55.000000 38672 /usr/local/include/grape/worker/worker.h:120] [Coordinator]: Finished IncEval - 1
>>> print(ret2.schema)
oid_type: LONG
vid_type: ULONG
type: VERTEX
Label: person
Properties: Property(4, result, LONG)

type: EDGE
Label: knows
Properties:
Relations: [Relation(source='person', destination='person')]

TODO: Some unittests is not updated yet.

Related work of #1329 Also cowork with v6d-io/v6d#676

siyuan0322 avatar Mar 14 '22 07:03 siyuan0322