Skip to content

Commit 43eced0

Browse files
committed
Adjust raw headers
Before this adjustment, the generation process displayed warning such as: 21/06/01 16:56:19 WARN CSVDataSource: CSV header does not conform to the schema. Header: creationDate, Person.id, University.id, classYear Schema: creationDate, PersonId, UniversityId, classYear
1 parent 736c30b commit 43eced0

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

src/main/java/ldbc/snb/datagen/serializer/DynamicActivitySerializer.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@ public void writeFileHeaders() {
6161

6262
List<String> dates2 = ImmutableList.of("creationDate", "deletionDate");
6363

64-
writers.get(FORUM) .writeHeader(dates1, ImmutableList.of("id", "title", "ModeratorPerson.id"));
65-
writers.get(FORUM_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("Forum.id", "Tag.id"));
66-
writers.get(FORUM_HASMEMBER_PERSON) .writeHeader(dates1, ImmutableList.of("Forum.id", "Person.id"));
64+
writers.get(FORUM) .writeHeader(dates1, ImmutableList.of("id", "title", "ModeratorPersonId"));
65+
writers.get(FORUM_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("ForumId", "TagId"));
66+
writers.get(FORUM_HASMEMBER_PERSON) .writeHeader(dates1, ImmutableList.of("ForumId", "PersonId"));
6767

68-
writers.get(POST) .writeHeader(dates1, ImmutableList.of("id", "imageFile", "locationIP", "browserUsed", "language", "content", "length", "CreatorPerson.id", "ContainerForum.id", "LocationCountry.id"));
69-
writers.get(POST_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("Post.id", "Tag.id"));
68+
writers.get(POST) .writeHeader(dates1, ImmutableList.of("id", "imageFile", "locationIP", "browserUsed", "language", "content", "length", "CreatorPersonId", "ContainerForumId", "LocationCountryId"));
69+
writers.get(POST_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("PostId", "TagId"));
7070

71-
writers.get(COMMENT) .writeHeader(dates1, ImmutableList.of("id", "locationIP", "browserUsed", "content", "length", "CreatorPerson.id", "LocationCountry.id", "ParentPost.id", "ParentComment.id"));
72-
writers.get(COMMENT_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("Comment.id", "Tag.id"));
71+
writers.get(COMMENT) .writeHeader(dates1, ImmutableList.of("id", "locationIP", "browserUsed", "content", "length", "CreatorPersonId", "LocationCountryId", "ParentPostId", "ParentCommentId"));
72+
writers.get(COMMENT_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("CommentId", "TagId"));
7373

74-
writers.get(PERSON_LIKES_POST) .writeHeader(dates1, ImmutableList.of("Person.id", "Post.id"));
75-
writers.get(PERSON_LIKES_COMMENT) .writeHeader(dates1, ImmutableList.of("Person.id", "Comment.id"));
74+
writers.get(PERSON_LIKES_POST) .writeHeader(dates1, ImmutableList.of("PersonId", "PostId"));
75+
writers.get(PERSON_LIKES_COMMENT) .writeHeader(dates1, ImmutableList.of("PersonId", "CommentId"));
7676

7777
}
7878

7979
public void serialize(final Forum forum) {
8080
List<String> dates = ImmutableList.of(formatDateTime(forum.getCreationDate()), formatDateTime(forum.getDeletionDate()), String.valueOf(forum.isExplicitlyDeleted()));
8181

82-
// creationDate, deletionDate, explicitlyDeleted, id, title, ModeratorPerson.id
82+
// creationDate, deletionDate, explicitlyDeleted, id, title, ModeratorPersonId
8383
writers.get(FORUM).writeEntry(dates, ImmutableList.of(
8484
Long.toString(forum.getId()),
8585
forum.getTitle(),
@@ -88,7 +88,7 @@ public void serialize(final Forum forum) {
8888

8989
List<String> dates2 = ImmutableList.of(formatDateTime(forum.getCreationDate()), formatDateTime(forum.getDeletionDate()));
9090
for (Integer i : forum.getTags()) {
91-
// creationDate, deletionDate, Forum.id, Tag.id
91+
// creationDate, deletionDate, ForumId, TagId
9292
writers.get(FORUM_HASTAG_TAG).writeEntry(dates2, ImmutableList.of(
9393
Long.toString(forum.getId()),
9494
Integer.toString(i)
@@ -100,7 +100,7 @@ public void serialize(final Forum forum) {
100100
public void serialize(final Post post) {
101101
List<String> dates1 = ImmutableList.of(formatDateTime(post.getCreationDate()), formatDateTime(post.getDeletionDate()), String.valueOf(post.isExplicitlyDeleted()));
102102

103-
// creationDate, deletionDate, explicitlyDeleted, id, imageFile, locationIP, browserUsed, language, content, length, CreatorPerson.id, ContainerForum.id, LocationCountry.id
103+
// creationDate, deletionDate, explicitlyDeleted, id, imageFile, locationIP, browserUsed, language, content, length, CreatorPersonId, ContainerForumId, LocationCountryId
104104
writers.get(POST).writeEntry(dates1, ImmutableList.of(
105105
Long.toString(post.getMessageId()),
106106
"",
@@ -117,7 +117,7 @@ public void serialize(final Post post) {
117117
List<String> dates2 = ImmutableList.of(formatDateTime(post.getCreationDate()), formatDateTime(post.getDeletionDate()));
118118

119119
for (Integer t : post.getTags()) {
120-
// creationDate, deletionDate, Post.id, Tag.id
120+
// creationDate, deletionDate, PostId, TagId
121121
writers.get(POST_HASTAG_TAG).writeEntry(dates2, ImmutableList.of(
122122
Long.toString(post.getMessageId()),
123123
Integer.toString(t)
@@ -128,7 +128,7 @@ public void serialize(final Post post) {
128128
public void serialize(final Comment comment) {
129129
List<String> dates1 = ImmutableList.of(formatDateTime(comment.getCreationDate()), formatDateTime(comment.getDeletionDate()), String.valueOf(comment.isExplicitlyDeleted()));
130130

131-
// creationDate, deletionDate, explicitlyDeleted, id, locationIP, browserUsed, content, length, CreatorPerson.id, LocationCountry.id, ParentPost.id, ParentComment.id
131+
// creationDate, deletionDate, explicitlyDeleted, id, locationIP, browserUsed, content, length, CreatorPersonId, LocationCountryId, ParentPostId, ParentCommentId
132132
writers.get(COMMENT).writeEntry(dates1, ImmutableList.of(
133133
Long.toString(comment.getMessageId()),
134134
comment.getIpAddress().toString(),
@@ -143,7 +143,7 @@ public void serialize(final Comment comment) {
143143

144144
List<String> dates2 = ImmutableList.of(formatDateTime(comment.getCreationDate()), formatDateTime(comment.getDeletionDate()));
145145
for (Integer t : comment.getTags()) {
146-
// creationDate, deletionDate, Comment.id, Tag.id
146+
// creationDate, deletionDate, CommentId, TagId
147147
writers.get(COMMENT_HASTAG_TAG).writeEntry(dates2, ImmutableList.of(
148148
Long.toString(comment.getMessageId()),
149149
Integer.toString(t)
@@ -154,7 +154,7 @@ public void serialize(final Comment comment) {
154154
public void serialize(final Photo photo) {
155155
List<String> dates1 = ImmutableList.of(formatDateTime(photo.getCreationDate()), formatDateTime(photo.getDeletionDate()), String.valueOf(photo.isExplicitlyDeleted()));
156156

157-
// creationDate, deletionDate, explicitlyDeleted, id, imageFile, locationIP, browserUsed, language, content, length, CreatorPerson.id, ContainerForum.id, LocationCountry.id
157+
// creationDate, deletionDate, explicitlyDeleted, id, imageFile, locationIP, browserUsed, language, content, length, CreatorPersonId, ContainerForumId, LocationCountryId
158158
writers.get(POST).writeEntry(dates1, ImmutableList.of(
159159
Long.toString(photo.getMessageId()),
160160
photo.getContent(),
@@ -170,7 +170,7 @@ public void serialize(final Photo photo) {
170170

171171
List<String> dates2 = ImmutableList.of(formatDateTime(photo.getCreationDate()), formatDateTime(photo.getDeletionDate()));
172172
for (Integer t : photo.getTags()) {
173-
// creationDate, deletionDate, Post.id, Tag.id
173+
// creationDate, deletionDate, PostId, TagId
174174
writers.get(POST_HASTAG_TAG).writeEntry(dates2, ImmutableList.of(
175175
Long.toString(photo.getMessageId()),
176176
Integer.toString(t)
@@ -181,7 +181,7 @@ public void serialize(final Photo photo) {
181181
public void serialize(final ForumMembership membership) {
182182
List<String> dates = ImmutableList.of(formatDateTime(membership.getCreationDate()), formatDateTime(membership.getDeletionDate()), String.valueOf(membership.isExplicitlyDeleted()));
183183

184-
// creationDate, deletionDate, explicitlyDeleted, Forum.id, Person.id
184+
// creationDate, deletionDate, explicitlyDeleted, ForumId, PersonId
185185
writers.get(FORUM_HASMEMBER_PERSON).writeEntry(dates, ImmutableList.of(
186186
Long.toString(membership.getForumId()),
187187
Long.toString(membership.getPerson().getAccountId())
@@ -191,9 +191,9 @@ public void serialize(final ForumMembership membership) {
191191
public void serialize(final Like like) {
192192
List<String> dates = ImmutableList.of(formatDateTime(like.getCreationDate()), formatDateTime(like.getDeletionDate()), String.valueOf(like.isExplicitlyDeleted()));
193193

194-
// creationDate, deletionDate, explicitlyDeleted, Person.id, Post.id
194+
// creationDate, deletionDate, explicitlyDeleted, PersonId, PostId
195195
// or
196-
// creationDate, deletionDate, explicitlyDeleted, Person.id, Comment.id
196+
// creationDate, deletionDate, explicitlyDeleted, PersonId, CommentId
197197
List<String> arguments = ImmutableList.of(
198198
Long.toString(like.getPerson()),
199199
Long.toString(like.getMessageId())

src/main/java/ldbc/snb/datagen/serializer/DynamicPersonSerializer.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,21 @@ public void writeFileHeaders() {
6060
List<String> dates1 = ImmutableList.of("creationDate", "deletionDate", "explicitlyDeleted");
6161

6262
// one-to-many edges, single- and multi-valued attributes
63-
writers.get(PERSON) .writeHeader(dates1, ImmutableList.of("id", "firstName", "lastName", "gender", "birthday", "locationIP", "browserUsed", "LocationCity.id", "language", "email"));
63+
writers.get(PERSON) .writeHeader(dates1, ImmutableList.of("id", "firstName", "lastName", "gender", "birthday", "locationIP", "browserUsed", "LocationCityId", "language", "email"));
6464

6565
// many-to-many edges
66-
writers.get(PERSON_KNOWS_PERSON) .writeHeader(dates1, ImmutableList.of("Person1.id", "Person2.id"));
66+
writers.get(PERSON_KNOWS_PERSON) .writeHeader(dates1, ImmutableList.of("Person1Id", "Person2Id"));
6767

6868
List<String> dates2 = ImmutableList.of("creationDate", "deletionDate");
69-
writers.get(PERSON_HASINTEREST_TAG) .writeHeader(dates2, ImmutableList.of("Person.id", "Tag.id"));
70-
writers.get(PERSON_STUDYAT_UNIVERSITY) .writeHeader(dates2, ImmutableList.of("Person.id", "University.id", "classYear"));
71-
writers.get(PERSON_WORKAT_COMPANY) .writeHeader(dates2, ImmutableList.of("Person.id", "Company.id", "workFrom"));
69+
writers.get(PERSON_HASINTEREST_TAG) .writeHeader(dates2, ImmutableList.of("PersonId", "TagId"));
70+
writers.get(PERSON_STUDYAT_UNIVERSITY) .writeHeader(dates2, ImmutableList.of("PersonId", "UniversityId", "classYear"));
71+
writers.get(PERSON_WORKAT_COMPANY) .writeHeader(dates2, ImmutableList.of("PersonId", "CompanyId", "workFrom"));
7272
}
7373

7474
public void serialize(final Person person) {
7575
List<String> dates1 = ImmutableList.of(formatDateTime(person.getCreationDate()), formatDateTime(person.getDeletionDate()), String.valueOf(person.isExplicitlyDeleted()));
7676

77-
// creationDate, deletionDate, explicitlyDeleted, id, firstName, lastName, gender, birthday, locationIP, browserUsed, LocationCity.id, language, email
77+
// creationDate, deletionDate, explicitlyDeleted, id, firstName, lastName, gender, birthday, locationIP, browserUsed, LocationCityId, language, email
7878
writers.get(PERSON).writeEntry(dates1, ImmutableList.of(
7979
Long.toString(person.getAccountId()),
8080
person.getFirstName(),
@@ -90,7 +90,7 @@ public void serialize(final Person person) {
9090

9191
List<String> dates2 = ImmutableList.of(formatDateTime(person.getCreationDate()), formatDateTime(person.getDeletionDate()));
9292
for (Integer interestIdx : person.getInterests()) {
93-
// creationDate, deletionDate, Person.id, Tag.id
93+
// creationDate, deletionDate, PersonId, TagId
9494
writers.get(PERSON_HASINTEREST_TAG).writeEntry(dates2, ImmutableList.of(
9595
Long.toString(person.getAccountId()),
9696
Integer.toString(interestIdx)
@@ -101,7 +101,7 @@ public void serialize(final Person person) {
101101
public void serialize(final StudyAt studyAt, final Person person) {
102102
List<String> dates = ImmutableList.of(formatDateTime(person.getCreationDate()), formatDateTime(person.getDeletionDate()));
103103

104-
// creationDate, deletionDate, Person.id, University.id, classYear
104+
// creationDate, deletionDate, PersonId, UniversityId, classYear
105105
writers.get(PERSON_STUDYAT_UNIVERSITY).writeEntry(dates, ImmutableList.of(
106106
Long.toString(studyAt.person),
107107
Long.toString(studyAt.university),
@@ -112,7 +112,7 @@ public void serialize(final StudyAt studyAt, final Person person) {
112112
public void serialize(final WorkAt workAt, final Person person) {
113113
List<String> dates = ImmutableList.of(formatDateTime(person.getCreationDate()), formatDateTime(person.getDeletionDate()));
114114

115-
// creationDate, deletionDate, Person.id, Company.id, workFrom
115+
// creationDate, deletionDate, PersonId, CompanyId, workFrom
116116
writers.get(PERSON_WORKAT_COMPANY).writeEntry(dates, ImmutableList.of(
117117
Long.toString(workAt.person),
118118
Long.toString(workAt.company),
@@ -123,7 +123,7 @@ public void serialize(final WorkAt workAt, final Person person) {
123123
public void serialize(final Person person, Knows knows) {
124124
List<String> dates = ImmutableList.of(formatDateTime(knows.getCreationDate()), formatDateTime(knows.getDeletionDate()), String.valueOf(knows.isExplicitlyDeleted()));
125125

126-
// creationDate, deletionDate, explicitlyDeleted, Person1.id, Person2.id
126+
// creationDate, deletionDate, explicitlyDeleted, Person1Id, Person2Id
127127
writers.get(PERSON_KNOWS_PERSON).writeEntry(dates, ImmutableList.of(
128128
Long.toString(person.getAccountId()),
129129
Long.toString(knows.to().getAccountId())

0 commit comments

Comments
 (0)