Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同一schema配置多个文件 #147

Closed
AlexYangLi opened this issue Jun 24, 2021 · 2 comments
Closed

同一schema配置多个文件 #147

AlexYangLi opened this issue Jun 24, 2021 · 2 comments

Comments

@AlexYangLi
Copy link

你好,想请教一下。假如我在yaml里面分别配置了两个path:student_0.csv和student_1.csv,都用于导入schema是student(具有属性:name)的点数据。两个文件可能包含vertext id相同的student数据。请问:

  1. 最后读到的点个数是两个文件数据的并集吗?
  2. 假如对于同一个student(vertext id相同),在student_0.csv里name属性是”A“,但在student_1.csv里name属性是”B“,请问最终在图空间里name属性会是什么?
@wey-gu
Copy link
Contributor

wey-gu commented Jun 24, 2021

Dear @AlexYangLi

  1. Underlying, the importer will do nGQL INSERT, and those lines with the same VID will override inserted ones.
  2. It will be the value parsed at the latest time.
(user@nebula) [basketballplayer]> insert vertex player(name,age) values "player106":("Kyle Anderson", 25);
Execution succeeded (time spent 1871/2442 us)

Thu, 24 Jun 2021 06:40:29 UTC

(user@nebula) [basketballplayer]> FETCH PROP ON player "player106";
+------------------------------------------------------------------------+
| vertices_                                                              |
+------------------------------------------------------------------------+
| ("player106" :player{age: 25, name: "Kyle Anderson", name1: __NULL__}) |
+------------------------------------------------------------------------+
Got 1 rows (time spent 1816/2356 us)

Thu, 24 Jun 2021 06:40:31 UTC

(user@nebula) [basketballplayer]> insert vertex player(name,age) values "player106":("Kyle Anderson", 125);
Execution succeeded (time spent 1756/2381 us)

Thu, 24 Jun 2021 06:40:40 UTC

(user@nebula) [basketballplayer]> FETCH PROP ON player "player106";
+-------------------------------------------------------------------------+
| vertices_                                                               |
+-------------------------------------------------------------------------+
| ("player106" :player{age: 125, name: "Kyle Anderson", name1: __NULL__}) |
+-------------------------------------------------------------------------+
Got 1 rows (time spent 1819/2465 us)

Thu, 24 Jun 2021 06:40:41 UTC

https://docs.nebula-graph.com.cn/2.0.1/3.ngql-guide/12.vertex-statements/1.insert-vertex/

@AlexYangLi
Copy link
Author

Got it! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants