timestamp类型时间写入失败

  • nebula 版本:2.0.0
    -studio版本:2.1.9-beta
  • 部署方式:单机
  • 问题的具体描述
    创建顶点语句
    CREATE TAG IF NOT EXISTS phone(jzdh string,khrq timestamp DEFAULT 0,tjrq timestamp DEFAULT 0,jzzt string);
    手动插入语句
    insert vertex phone(jzdh,khrq,tjrq,jzzt) values “12345678911”:(“12345678911”, “2018-09-13 17:01:25”,“2018-09-13 17:01:25”,“在用”);
    直接报错:Storage Error:the data type does not meet the requirements.Use the correct type of data。

我先使用nebula-exchange从hive导入数据, 结果查询不到顶点,然后在studio中使用insert vertex语句手动插入,如上所示,也是失败的。但是我查看官方文档,基本数据类型 - Nebula Graph 手册 ,是支持时间类型插入timestamp里的。这是怎么回事呢??

  • 相关的 meta / storage / graph info 日志信息

时间类型的文档参考这里:

https://docs.nebula-graph.io/2.0.1/3.ngql-guide/3.data-types/4.date-and-time/#timestamp

感谢反馈,你的连接里的内容不太对
https://docs.nebula-graph.com.cn/2.0.1/3.ngql-guide/3.data-types/4.date-and-time/#timestamp

nebula> CREATE TAG school(name string , found_time timestamp);

# 时间戳形式插入,1988-03-01T08:00:00对应的时间戳为573177600,转换为UTC时间为573206400。
nebula> INSERT VERTEX school(name, found_time) VALUES "DUT":("DUT", 573206400);

# 日期和时间格式插入。
nebula> INSERT VERTEX school(name, found_time) VALUES "DUT":("DUT", timestamp("1988-03-01T08:00:00"));

用insert语句可以使用date来处理,那用nebula-exchange导入怎么处理时间戳呢?要先把hive中的数据处理为int类型的时间戳么??

我发的连链接是1.0的中文文档吧???2.x的中文文档还没有么??

https://docs.nebula-graph.com.cn/2.0.1/3.ngql-guide/3.data-types/4.date-and-time/

如果用 nebula-exchange 的话,要么用 int 的时间戳,要么就是一个时间格式的字符串,如 1988-03-01T08:00:00

如果是字符串,注意是 UTC 的时间。

好的,多谢

2.x的中文文档在这里: nebula-spark-utils/nebula-exchange/doc-2.0/CN at master · vesoft-inc/nebula-spark-utils · GitHub

nebula-exchange的2.x文档我看到了,已经顺利接入数据。多谢回复