graphscope.declare

graphscope.declare(graphscope_type, variable)[源代码]

声明一个GraphScope数据类型。

Parameters:
  • graphscope_type (graphscope.analytical.udf.GraphScopeType) – 有效选项为 graphscope.Vertex

  • variable – Python变量。

示例

>>> @pie(vd_type="string", md_type="string")
>>> class MyAlgorithm(AppAssets):
>>>     @staticmethod
>>>     def Init(frag, context):
>>>         graphscope.declare(graphscope.Vertex, source)
>>>         # means `Vertex source;` in c++ code
>>>     @staticmethod
>>>     def PEval(frag, context):
>>>         pass
>>>     @staticmethod
>>>     def IncEval(frag, context):
>>>         pass