Star

v2版本NULL值如何查询的问题

  • nebula 版本:v2-nightly
  • 部署方式(分布式 / 单机 / Docker / DBaaS):分布式
    2.0版本中可以支持NULL值插入,那么插入、创建索引、更新索引之后如何查询NULL值的节点?
    自行尝试发现似乎不可以,代码如下:
(root@nebula) [stock]> DESCRIBE TAG person
+----------+----------+-------+---------+
| Field    | Type     | Null  | Default |
+----------+----------+-------+---------+
| "name"   | "string" | "YES" |         |
+----------+----------+-------+---------+
| "gender" | "string" | "YES" |         |
+----------+----------+-------+---------+
| "age"    | "int64"  | "YES" |         |
+----------+----------+-------+---------+
Got 3 rows (time spent 1853/2965 us)

(root@nebula) [stock]> CREATE TAG INDEX person_index_name on person(name(4));
Execution succeeded (time spent 9759/10622 us)

(root@nebula) [stock]> INSERT VERTEX person(name) VALUES "xxxxxxxxxxxxxxxxxxxxxxxx":("杜玉岱")
Execution succeeded (time spent 3719/4775 us)

(root@nebula) [stock]> FETCH PROP ON person "xxxxxxxxxxxxxxxxxxxxxxxx"
+----------------------------+-------------+---------------+------------+
| VertexID                   | person.name | person.gender | person.age |
+----------------------------+-------------+---------------+------------+
| "xxxxxxxxxxxxxxxxxxxxxxxx" | "杜玉岱"    | NULL          | NULL       |
+----------------------------+-------------+---------------+------------+
Got 1 rows (time spent 1930/2979 us)

(root@nebula) [stock]> REBUILD TAG INDEX person_index_name
+------------+
| New Job Id |
+------------+
| 74         |
+------------+
Got 1 rows (time spent 5874/6808 us)

(root@nebula) [stock]> LOOKUP ON person where person.gender == NULL
[ERROR (-12)]: SemanticError: expression error : person.gender

Wed, 06 Jan 2021 11:02:11 CST

(root@nebula) [stock]> LOOKUP ON person where person.gender == 'NULL'
Empty set (time spent 2595/3614 us)

Wed, 06 Jan 2021 11:03:16 CST


索引目前不支持null查询,索引使用限制详情看文档

好的,谢谢

浙ICP备20010487号