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

   ### Problem Type (问题类型)
   
   other exception / error (其他异常报错)
   
   ### Before submit
   
   - [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 
[FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have 
confirmed and searched that there are no similar problems in the historical 
issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: 1.0.0 (Apache Release Version)
   - Backend: RocksDB x nodes, HDD or SSD 
   - OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x 
   - Data Size:  xx vertices, xx edges <!-- (like 1000W 点, 9000W 边) -->
   
   
   ### Your Question (问题描述)
   
   java 
   public class HiveSqlStatementsParser extends HiveSqlBaseVisitor {
    @Override
       public Object 
visitCreate_table_stmt(HiveSqlParser.Create_table_stmtContext ctx) {
           HugeClient hugeClient = ConstellHugeClient.getInstance();
           GraphManager graph = hugeClient.graph();
           Vertex zhangsan = graph.addVertex(T.label, "人物", "name", "张三",
                   "age", 29, "city", "Beijing");
           System.out.println("+++++");
   
   报错为
   Exception in thread "main" class java.lang.IllegalArgumentException: The 
properties of vertex can't be null
        at 
com.baidu.hugegraph.exception.ServerException.fromResponse(ServerException.java:47)
        at com.baidu.hugegraph.client.RestClient.checkStatus(RestClient.java:93)
        at 
com.baidu.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:231)
        at 
com.baidu.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:205)
        at com.baidu.hugegraph.api.graph.VertexAPI.create(VertexAPI.java:51)
        at 
com.baidu.hugegraph.driver.GraphManager.addVertex(GraphManager.java:59)
        at 
com.baidu.hugegraph.driver.GraphManager.addVertex(GraphManager.java:74)
   但是这段代码
          HugeClient hugeClient = ConstellHugeClient.getInstance();
           GraphManager graph = hugeClient.graph();
           Vertex zhangsan = graph.addVertex(T.label, "人物", "name", "张三",
                   "age", 29, "city", "Beijing");
   放入main函数中是正常的
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   _No response_
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   schema.propertyKey("name").asText().ifNotExist().create();
           schema.propertyKey("age").asInt().ifNotExist().create();
           schema.propertyKey("city").asText().ifNotExist().create();
           schema.propertyKey("weight").asDouble().ifNotExist().create();
           schema.propertyKey("lang").asText().ifNotExist().create();
           schema.propertyKey("date").asDate().ifNotExist().create();
           schema.propertyKey("price").asInt().ifNotExist().create();
   
           schema.vertexLabel("人物")
                   .properties("name", "age", "city")
                   .primaryKeys("name")
                   .ifNotExist()
                   .create();
   ```
   


-- 
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