Star

使用StorageClient的scan_vertex时,alert修改Tag后,报了('parsed version %d is not equal to version %d provided', 256, 0)

  • nebula 版本:1.2.0
  • nebula-python=1.1.1

问题描述:
按照 https://github.com/vesoft-inc/nebula-python/blob/v1.0/examples/StorageClientExample.py#L135,
使用了scan_vertex,成功拿到了vertex数据;
但是当我对space中的tag增加列并且写入新的数据后,步骤如下:

step 1: alter tag team add(weight int);
step 2: instert vertex team(name,weight) values 14:('Lakers',12);

在使用scan_vertex获取数据就报了如下:

############# scanned vertex data #############
Traceback (most recent call last):
  File "./easy-kbrain/utiles/nebulaclient/NebulaStorageHandle.py", line 50, in scan_vertex
    process_vertex(space, scan_vertex_response)
  File "./easy-kbrain/utiles/nebulaclient/NebulaStorageHandle.py", line 89, in process_vertex
    result = scan_vertex_processor.process(space, scan_vertex_response)
  File "/export/anaconda3/envs/graph/lib/python3.6/site-packages/nebula_python-1.1.1-py3.6.egg/nebula/ngStorage/ngProcessor/ScanVertexProcessor.py", line 60, in process
    properties = row_reader.decode_value(scan_tag.value)
  File "/export/anaconda3/envs/graph/lib/python3.6/site-packages/nebula_python-1.1.1-py3.6.egg/nebula/ngData/data.py", line 90, in decode_value
    raise Exception('parsed version %d is not equal to version %d provided', ver, schema_version)
Exception: ('parsed version %d is not equal to version %d provided', 256, 0)
('parsed version %d is not equal to version %d provided', 256, 0)

想请问:parsed version 为啥要和 schema_version 比较,我屏蔽调判断逻辑后是可以正常输出的?

感谢您的提问,因为你读到的数据是用的旧版本的schema数据,假如直接用新版本处理会异常的,这里只是简单的报错了。正常的流程需要做些处理,比如新加的字段要填默认值,删除的字段要跳过,字段类型修改了需要做类型转换等等。这是个bug,我们尽快修复。

1赞

浙ICP备20010487号