Skip to content

Commit d1e041d

Browse files
authored
Merge pull request #302 from ldbc/use-more-specific-endpoint-labels
Use more specific endpoint labels
2 parents 2ebdaf2 + 1cfff12 commit d1e041d

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public void writeFileHeaders() {
6565
writers.get(FORUM_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("Forum.id", "Tag.id"));
6666
writers.get(FORUM_HASMEMBER_PERSON) .writeHeader(dates1, ImmutableList.of("Forum.id", "Person.id"));
6767

68-
writers.get(POST) .writeHeader(dates1, ImmutableList.of("id", "imageFile", "locationIP", "browserUsed", "language", "content", "length", "creator", "Forum.id", "place"));
68+
writers.get(POST) .writeHeader(dates1, ImmutableList.of("id", "imageFile", "locationIP", "browserUsed", "language", "content", "length", "creator", "Forum.id", "Country.id"));
6969
writers.get(POST_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("Post.id", "Tag.id"));
7070

71-
writers.get(COMMENT) .writeHeader(dates1, ImmutableList.of("id", "locationIP", "browserUsed", "content", "length", "creator", "place", "replyOfPost", "replyOfComment"));
71+
writers.get(COMMENT) .writeHeader(dates1, ImmutableList.of("id", "locationIP", "browserUsed", "content", "length", "creator", "Country.id", "replyOfPost", "replyOfComment"));
7272
writers.get(COMMENT_HASTAG_TAG) .writeHeader(dates2, ImmutableList.of("Comment.id", "Tag.id"));
7373

7474
writers.get(PERSON_LIKES_POST) .writeHeader(dates1, ImmutableList.of("Person.id", "Post.id"));

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ 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", "place", "language", "email"));
63+
writers.get(PERSON) .writeHeader(dates1, ImmutableList.of("id", "firstName", "lastName", "gender", "birthday", "locationIP", "browserUsed", "city", "language", "email"));
6464

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

6868
List<String> dates2 = ImmutableList.of("creationDate", "deletionDate");
6969
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", "Organisation.id", "classYear"));
71-
writers.get(PERSON_WORKAT_COMPANY) .writeHeader(dates2, ImmutableList.of("Person.id", "Organisation.id", "workFrom"));
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"));
7272
}
7373

7474
public void serialize(final Person person) {

src/main/scala/ldbc/snb/datagen/transformation/TransformationStage.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ object TransformationStage extends SparkApp with Logging {
4343
"`id` INT, `name` STRING, `url` STRING, `isSubclassOf` INT"
4444
),
4545
Node("Comment") -> Some(
46-
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `explicitlyDeleted` BOOLEAN, `id` BIGINT, `locationIP` STRING, `browserUsed` STRING, `content` STRING, `length` INT, `creator` BIGINT, `place` INT, `replyOfPost` BIGINT, `replyOfComment` BIGINT"
46+
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `explicitlyDeleted` BOOLEAN, `id` BIGINT, `locationIP` STRING, `browserUsed` STRING, `content` STRING, `length` INT, `Person.id` BIGINT, `Country.id` INT, `replyOfPost` BIGINT, `replyOfComment` BIGINT"
4747
),
4848
Edge("HasTag", "Comment", "Tag", NN) -> Some(
4949
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `Comment.id` BIGINT, `Tag.id` INT"
@@ -58,7 +58,7 @@ object TransformationStage extends SparkApp with Logging {
5858
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `Forum.id` BIGINT, `Tag.id` INT"
5959
),
6060
Node("Person") -> Some(
61-
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `explicitlyDeleted` BOOLEAN, `id` BIGINT, `firstName` STRING, `lastName` STRING, `gender` STRING, `birthday` DATE, `locationIP` STRING, `browserUsed` STRING, `place` INT, `language` STRING, `email` STRING"
61+
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `explicitlyDeleted` BOOLEAN, `id` BIGINT, `firstName` STRING, `lastName` STRING, `gender` STRING, `birthday` DATE, `locationIP` STRING, `browserUsed` STRING, `City.id` INT, `language` STRING, `email` STRING"
6262
),
6363
Edge("HasInterest", "Person", "Tag", NN) -> Some(
6464
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `Person.id` BIGINT, `Tag.id` INT"
@@ -79,7 +79,7 @@ object TransformationStage extends SparkApp with Logging {
7979
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `Person.id` BIGINT, `Company.id` INT, `workFrom` INT"
8080
),
8181
Node("Post") -> Some(
82-
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `explicitlyDeleted` BOOLEAN, `id` BIGINT, `imageFile` STRING, `locationIP` STRING, `browserUsed` STRING, `language` STRING, `content` STRING, `length` INT, `creator` BIGINT, `Forum.id` BIGINT, `place` INT"
82+
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `explicitlyDeleted` BOOLEAN, `id` BIGINT, `imageFile` STRING, `locationIP` STRING, `browserUsed` STRING, `language` STRING, `content` STRING, `length` INT, `Person.id` BIGINT, `Forum.id` BIGINT, `Country.id` INT"
8383
),
8484
Edge("HasTag", "Post", "Tag", NN) -> Some(
8585
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `Post.id` BIGINT, `Tag.id` INT"

src/main/scala/ldbc/snb/datagen/transformation/transform/ExplodeEdges.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,27 @@ object ExplodeEdges extends Transform[Mode.Raw.type, Mode.Raw.type]{
4141
k -> v.drop("isSubclassOf")
4242
)
4343
case (k@Node("Comment", false), v) => Map(
44-
explodedEdge(Edge("HasCreator", "Comment", "Person", OneN), v, $"creator"),
45-
explodedEdge(Edge("IsLocatedIn", "Comment", "Place", OneN), v, $"place"),
44+
explodedEdge(Edge("HasCreator", "Comment", "Person", OneN), v, $"`Person.id`"),
45+
explodedEdge(Edge("IsLocatedIn", "Comment", "Country", OneN), v, $"`Country.id`"),
4646
explodedEdge(Edge("ReplyOf", "Comment", "Comment", OneN), v, $"replyOfComment"),
4747
explodedEdge(Edge("ReplyOf", "Comment", "Post", OneN), v, $"replyOfPost"),
48-
k -> v.drop("creator", "place", "replyOfPost", "replyOfComment")
48+
k -> v.drop("Person.id", "Country.id", "replyOfPost", "replyOfComment")
4949
)
5050
case (k@Node("Forum", false), v) => Map(
5151
explodedEdge(Edge("HasModerator", "Forum", "Person", OneN), v, $"moderator"),
5252
k -> v.drop("moderator")
5353
)
5454

5555
case (k@Node("Person", false), v) => Map(
56-
explodedEdge(Edge("IsLocatedIn", "Person", "Place", OneN), v, $"place"),
57-
k -> v.drop("place")
56+
explodedEdge(Edge("IsLocatedIn", "Person", "City", OneN), v, $"`City.id`"),
57+
k -> v.drop("City.id")
5858
)
5959

6060
case (k@Node("Post", false), v) => Map(
61-
explodedEdge(Edge("HasCreator", "Post", "Person", OneN), v, $"creator"),
62-
explodedEdge(Edge("IsLocatedIn", "Post", "Place", OneN), v, $"place"),
61+
explodedEdge(Edge("HasCreator", "Post", "Person", OneN), v, $"`Person.id`"),
62+
explodedEdge(Edge("IsLocatedIn", "Post", "Country", OneN), v, $"`Country.id`"),
6363
explodedEdge(Edge("ContainerOf", "Forum", "Post", NOne), v, $"`Forum.id`"),
64-
k -> v.drop("creator", "place", "`Forum.id`")
64+
k -> v.drop("Person.id", "Country.id", "Forum.id")
6565
)
6666
}.foldLeft(entities)(_ ++ _)
6767

0 commit comments

Comments
 (0)