Skip to content

[Bug] drop报错 Non-null property 'xxx' is null for xxx #2062

@gudehuang

Description

@gudehuang

Bug Type (问题类型)

gremlin (结果不合预期)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题

Environment (环境信息)

  • Server Version: v0.12.0
  • Backend: RocksDB x nodes, HDD or SSD
  • OS: xx CPUs, xx G RAM, Centos 7.x
  • Data Size: xx vertices, xx edges

Expected & Actual behavior (期望与实际表现)

通过某个顶点的某些边找到目标顶点并删除

g.V(653882732132171776).hasLabel('syndromes').in('syndromes_child_group_to_syndromes_edge')
  .drop()

执行报错

Gremlin 执行失败,详细信息: Non-null property 'name(id=75)' is null for 'v[653952259255697408]'

但直接通过id去删除是可以正常删除的

g.V(653952259255697408).drop()

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

复现步骤:

  1. 创建数据
schema = graph.schema()
// 创建属性
schema.propertyKey("sysFlags").asText().ifNotExist().create();
schema.propertyKey("treatmentPrinciples").asText().ifNotExist().create();
schema.propertyKey("pid").asLong().ifNotExist().create();
schema.propertyKey("type").asInt().ifNotExist().create();
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("createdAt").asDate().ifNotExist().create();
schema.propertyKey("updatedAt").asDate().ifNotExist().create();
schema.propertyKey("sort").asInt().ifNotExist().create();

schema.propertyKey("categoryId").asLong().ifNotExist().create();
schema.propertyKey("syndromesType").asInt().ifNotExist().create();
schema.propertyKey("syndromesCode").asText().ifNotExist().create();
schema.propertyKey("syndromesName").asText().ifNotExist().create();
schema.propertyKey("syndromesNameForEn").asText().ifNotExist().create();
schema.propertyKey("syndromesNameForZhCht").asText().ifNotExist().create();
schema.propertyKey("syndromesDesc").asText().ifNotExist().create();
schema.propertyKey("syndromesThreshold").asText().ifNotExist().create();
schema.propertyKey("treatmentLevel").asText().ifNotExist().create();
schema.propertyKey("syndromesGlobal").asBoolean().ifNotExist().create();
schema.propertyKey("createdAt").asDate().ifNotExist().create();
schema.propertyKey("updatedAt").asDate().ifNotExist().create();

schema.propertyKey("treatmentRule").asText().ifNotExist().create();


schema.propertyKey("degreeType").asInt().ifNotExist().create();
schema.propertyKey("degreeSeparatedValueL").asText().ifNotExist().create();
schema.propertyKey("degreeSeparatedValueM").asText().ifNotExist().create();

schema.propertyKey("code").asText().ifNotExist().create();
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("threshold").asInt().ifNotExist().create();
schema.propertyKey("totalContribution").asInt().ifNotExist().create();
schema.propertyKey("syndromesId").asLong().ifNotExist().create();
schema.propertyKey("isUngrouped").asBoolean().ifNotExist().create();


schema.propertyKey("type").asInt().ifNotExist().create();
schema.propertyKey("syndromesId").asLong().ifNotExist().create();


schema.propertyKey("type").asInt().ifNotExist().create();
schema.propertyKey("syndromesId").asLong().ifNotExist().create();




schema.propertyKey("contribution").asInt().ifNotExist().create();

schema.propertyKey("contributionOfLight").asInt().ifNotExist().create();
schema.propertyKey("contributionOfMedium").asInt().ifNotExist().create();
schema.propertyKey("contributionOfHigh").asInt().ifNotExist().create();





schema.propertyKey("code").asText().ifNotExist().create();
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("threshold").asInt().ifNotExist().create();
schema.propertyKey("totalContribution").asInt().ifNotExist().create();
schema.propertyKey("syndromesId").asLong().ifNotExist().create();

schema.propertyKey("weightOfLight").asText().ifNotExist().create();
schema.propertyKey("weightOfMedium").asText().ifNotExist().create();
schema.propertyKey("weightOfHigh").asText().ifNotExist().create();

schema.propertyKey("isMutex").asBoolean().ifNotExist().create();

schema.propertyKey("symptomId").asLong().ifNotExist().create();

schema.propertyKey("sysFlag").asText().ifNotExist().create();


// 创建顶点
schema.vertexLabel('syndromes').properties("sort", "treatmentRule", "syndromesGlobal", "syndromesNameForEn", "createdAt", "syndromesNameForZhCht", "updatedAt", "pid", "type", "degreeType", "degreeSeparatedValueL", "degreeSeparatedValueM", "categoryId", "syndromesType", "syndromesCode", "syndromesName", "syndromesDesc", "syndromesThreshold", "treatmentLevel", "sysFlags", "sysFlag", "treatmentPrinciples")
    .nullableKeys("sort", "treatmentRule", "syndromesGlobal", "syndromesNameForEn", "createdAt", "syndromesNameForZhCht", "updatedAt", "pid", "type", "degreeType", "degreeSeparatedValueL", "degreeSeparatedValueM", "sysFlags", "sysFlag", "treatmentPrinciples")
    .useAutomaticId()
    .ifNotExist().create();


schema.vertexLabel('syndromes_child').properties("code", "name", "threshold", "totalContribution", "syndromesId", "isUngrouped"
    , "createdAt", "updatedAt")
    .nullableKeys("createdAt", "updatedAt")
    .useAutomaticId()
    .ifNotExist().create();

//创建顶点边
schema.edgeLabel('syndromes_child_to_syndromes_edge').link('syndromes_child', 'syndromes')
    .properties("name")
    .ifNotExist().create();


//创建索引

schema.indexLabel('syndromesChildSecondaryByIsUngrouped').onV('syndromes_child').by('isUngrouped').secondary().ifNotExist().create()
schema.indexLabel('syndromesChildSecondaryByCode').onV('syndromes_child').by('code').secondary().ifNotExist().create()
schema.indexLabel('syndromesChildSecondaryByName').onV('syndromes_child').by('name').secondary().ifNotExist().create()
schema.indexLabel('syndromesChildSecondaryBySyndromesId').onV('syndromes_child').by('syndromesId').secondary().ifNotExist().create()


//创建顶点和边
g.addV('syndromes').property('sysFlag', 'flu,cons').property('degreeType', -1).property('syndromesDesc', '开发测试证候102').property('pid', 657981153491288064).property('sort', 16).property('type', 1).property('syndromesThreshold', '0').property('createdAt', '2023-01-05 17:45:03').property('syndromesName', '开发测试证候102').property('syndromesCode', 'ID_ZH_KaiFaCeShiZhengHou102').property('syndromesNameForZhCht', '').property('treatmentPrinciples', '补气').property('treatmentLevel', '1').property('syndromesNameForEn', '').property('syndromesType', 0).property('categoryId', 0).property('syndromesGlobal', false).property('updatedAt', '2023-01-05 17:45:03').as('a')
    .addV('syndromes_child').property('createdAt', '2023-01-05 17:45:53').property('syndromesId', 675759013408800768).property('code', 'CID_KaiFaCeShiZhengHou102_BiaoXiangZu-01').property('totalContribution', 0).property('name', '表象组-01').property('isUngrouped', true).property('threshold', 0).property('updatedAt', '2023-01-05 17:45:53').as('b')
    .addE('syndromes_child_to_syndromes_edge').from('b').to('a').property('name', '子证候关联的证候')

  1. 删除数据
g.V().hasLabel('syndromes').in('syndromes_child_to_syndromes_edge')
  .drop()

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions