Skip to content

Commit 028e530

Browse files
committed
Rework column names for better names in MergedFK output
1 parent 43eced0 commit 028e530

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ public List<FileName> getFileNames() {
5757

5858
@Override
5959
public void writeFileHeaders() {
60-
writers.get(TAG).writeHeader(ImmutableList.of("id", "name", "url", "hasType"));
61-
writers.get(TAGCLASS).writeHeader(ImmutableList.of("id", "name", "url", "isSubclassOf"));
62-
writers.get(PLACE).writeHeader(ImmutableList.of("id", "name", "url", "type", "isPartOf"));
63-
writers.get(ORGANISATION).writeHeader(ImmutableList.of("id", "type", "name", "url", "place"));
60+
writers.get(ORGANISATION).writeHeader(ImmutableList.of("id", "type", "name", "url", "LocationPlaceId"));
61+
writers.get(PLACE).writeHeader(ImmutableList.of("id", "name", "url", "type", "PartOfPlaceId"));
62+
writers.get(TAG).writeHeader(ImmutableList.of("id", "name", "url", "TypeTagClassId"));
63+
writers.get(TAGCLASS).writeHeader(ImmutableList.of("id", "name", "url", "SubclassOfTagClassId"));
6464
}
6565

6666
public void serialize(final Place place) {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ object TransformationStage extends SparkApp with Logging {
3131
Mode.Raw,
3232
Map(
3333
Node("Organisation", isStatic = true) -> Some(
34-
"`id` INT, `type` STRING, `name` STRING, `url` STRING, `place` INT"
34+
"`id` INT, `type` STRING, `name` STRING, `url` STRING, `LocationPlaceId` INT"
3535
),
3636
Node("Place", isStatic = true) -> Some(
37-
"`id` INT, `name` STRING, `url` STRING, `type` STRING, `isPartOf` INT"
37+
"`id` INT, `name` STRING, `url` STRING, `type` STRING, `PartOfPlaceId` INT"
3838
),
3939
Node("Tag", isStatic = true) -> Some(
40-
"`id` INT, `name` STRING, `url` STRING, `hasType` INT"
40+
"`id` INT, `name` STRING, `url` STRING, `TypeTagClassId` INT"
4141
),
4242
Node("TagClass", isStatic = true) -> Some(
43-
"`id` INT, `name` STRING, `url` STRING, `isSubclassOf` INT"
43+
"`id` INT, `name` STRING, `url` STRING, `SubclassOfTagClassId` INT"
4444
),
4545
Node("Comment") -> Some(
4646
"`creationDate` TIMESTAMP, `deletionDate` TIMESTAMP, `explicitlyDeleted` BOOLEAN, `id` BIGINT, `locationIP` STRING, `browserUsed` STRING, `content` STRING, `length` INT, `CreatorPersonId` BIGINT, `LocationCountryId` INT, `ParentPostId` BIGINT, `ParentCommentId` BIGINT"

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ object ExplodeEdges extends Transform[Mode.Raw.type, Mode.Raw.type]{
2525

2626
val updatedEntities = entities.collect {
2727
case (k@Node("Organisation", true), v) => Map(
28-
explodedEdge(Edge("IsLocatedIn", "Organisation", "Place", OneN, isStatic = true), v, $"place"),
29-
k -> v.drop("place")
28+
explodedEdge(Edge("IsLocatedIn", "Organisation", "Place", OneN, isStatic = true), v, $"LocationPlaceId"),
29+
k -> v.drop("LocationPlaceId")
3030
)
3131
case (k@Node("Place", true), v) => Map(
32-
explodedEdge(Edge("IsPartOf", "Place", "Place", OneN, isStatic = true), v, $"isPartOf"),
33-
k -> v.drop("isPartOf")
32+
explodedEdge(Edge("IsPartOf", "Place", "Place", OneN, isStatic = true), v, $"PartOfPlaceId"),
33+
k -> v.drop("PartOfPlaceId")
3434
)
3535
case (k@Node("Tag", true), v) => Map(
36-
explodedEdge(Edge("HasType", "Tag", "TagClass", OneN, isStatic = true), v, $"hasType"),
37-
k -> v.drop("hasType")
36+
explodedEdge(Edge("HasType", "Tag", "TagClass", OneN, isStatic = true), v, $"TypeTagClassId"),
37+
k -> v.drop("TypeTagClassId")
3838
)
3939
case (k@Node("TagClass", true), v) => Map(
40-
explodedEdge(Edge("IsSubclassOf", "TagClass", "TagClass", OneN, isStatic = true), v, $"isSubclassOf"),
41-
k -> v.drop("isSubclassOf")
40+
explodedEdge(Edge("IsSubclassOf", "TagClass", "TagClass", OneN, isStatic = true), v, $"SubclassOfTagClassId"),
41+
k -> v.drop("SubclassOfTagClassId")
4242
)
4343
case (k@Node("Comment", false), v) => Map(
4444
explodedEdge(Edge("HasCreator", "Comment", "Person", OneN), v, $"CreatorPersonId"),
@@ -59,8 +59,8 @@ object ExplodeEdges extends Transform[Mode.Raw.type, Mode.Raw.type]{
5959

6060
case (k@Node("Post", false), v) => Map(
6161
explodedEdge(Edge("HasCreator", "Post", "Person", OneN), v, $"CreatorPersonId"),
62-
explodedEdge(Edge("IsLocatedIn", "Post", "Country", OneN), v, $"LocationCountryId"),
6362
explodedEdge(Edge("ContainerOf", "Forum", "Post", NOne), v, $"ContainerForumId"),
63+
explodedEdge(Edge("IsLocatedIn", "Post", "Country", OneN), v, $"LocationCountryId"),
6464
k -> v.drop("CreatorPersonId", "LocationCountryId", "ContainerForumId")
6565
)
6666
}.foldLeft(entities)(_ ++ _)

0 commit comments

Comments
 (0)