gudehuang opened a new issue, #2025:
URL: https://github.com/apache/incubator-hugegraph/issues/2025

   ### Bug Type (问题类型)
   
   gremlin (结果不合预期)
   
   ### Before submit
   
   - [X] 我已经确认现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 
[FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有相同 / 重复问题
   
   ### 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 <!-- (like 1000W 点, 9000W 边) -->
   
   
   ### Expected & Actual behavior (期望与实际表现)
   
   更新偏性顶点的属性:
   ```
   g.V(659421981355016192).property('gtValue','25')
   ```
   通过分类顶点以及属于它的偏性列表数据:
   ```
   
g.V().hasLabel('bias_category').order().by('sort',asc).project('category','list').by(valueMap().with(WithOptions.tokens).by(unfold())).by(__.in('edge_bias_to_category').dedup().order().by('sort',asc).project('bias').by(valueMap().with(WithOptions.tokens)).fold())
   ```
   
   
   #### 期望表现
   拿到的偏性数据是最新的,gtValue=25
   
   #### 实际表现
   拿到的偏性数据是旧的,gtValue=20
   
![image](https://user-images.githubusercontent.com/20537541/202995600-c8529114-3ed5-4021-8050-6f1298fa2570.png)
   
   
   使用
   ```
   g.V(659421981355016192)
   ```
   和
   ```
   g.V().hasLabel('bias')
   ```
   查询得到数据是正常的
   
![image](https://user-images.githubusercontent.com/20537541/202995904-a43cb5fd-8a25-48d0-80cc-cc3755d25f3b.png)
   
   但使用
   ```
   
g.V().hasLabel('bias_category').order().by('sort',asc).project('category','list').by(valueMap().with(WithOptions.tokens).by(unfold())).by(__.in('edge_bias_to_category').dedup().order().by('sort',asc).project('bias').by(valueMap().with(WithOptions.tokens)).fold())
   ```
   查询得到的数据是旧的,需要一段时间后才正常
   
![image](https://user-images.githubusercontent.com/20537541/202995600-c8529114-3ed5-4021-8050-6f1298fa2570.png)
   
   
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   _No response_
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   schema= graph.schema()
     // 创建属性
     schema.propertyKey("createdAt").asDate().ifNotExist().create();
     schema.propertyKey("updatedAt").asDate().ifNotExist().create();
     // 分类
     schema.propertyKey("type").asInt().ifNotExist().create();
     schema.propertyKey("name").asText().ifNotExist().create();
     schema.propertyKey("pid").asLong().ifNotExist().create();
     schema.propertyKey("sort").asText().ifNotExist().create();
     // 偏性
     schema.propertyKey("name").asText().ifNotExist().create();
     schema.propertyKey("categoryId").asLong().ifNotExist().create();
   
     schema.propertyKey("contribution").asInt().ifNotExist().create();
   
     schema.propertyKey("ltValue").asText().ifNotExist().create();
     schema.propertyKey("gtValue").asText().ifNotExist().create();
     // 创建顶点
     // 分类
     schema.vertexLabel("bias_category").properties("type", "name", 
"createdAt", "updatedAt", "pid", "sort")
             .nullableKeys("createdAt", "updatedAt", "pid", "sort")
             .useAutomaticId()
             .ifNotExist().create();
     // 偏性
     
schema.vertexLabel("bias").properties("ltValue","gtValue","sort","createdAt","updatedAt","type","name","categoryId")
             .nullableKeys("ltValue","gtValue","sort","createdAt","updatedAt")
             .useAutomaticId()
             .ifNotExist().create();
   
           // 偏性-> 分类
     schema.edgeLabel("edge_bias_to_category").link("bias", "bias_category")
                 .ifNotExist().create();
   
         // 分类--> 分类
     schema.edgeLabel("bias_category_to_category").link("bias_category", 
"bias_category")
                 .ifNotExist().create();     
   
   //创建一个分类顶点 和一个偏性顶点 ,新建边:偏性-> 分类
   
g.addV('bias_category').property('type',0).property('name','分类1').property('sort','0').as("a")
  
   
.addV('bias').property('type',0).property('categoryId',select('a').id()).property('name','偏性1').property('sort','0').property('ltValue','10').property('gtValue','20').addE("edge_bias_to_category").to('a')
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to