Skip to content

Commit d87b391

Browse files
committed
chore: fixed the index split key order
1 parent 8c50bd3 commit d87b391

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

samples/snippets/src/main/java/com/example/spanner/DatabaseAddSplitPointsSample.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void addSplitPoints(String projectId, String instanceId, String databaseI
8989
.build()))
9090
.build();
9191

92-
// index key with table key part
92+
// index key with table key part, first key is the index key and second is the table key
9393
com.google.spanner.admin.database.v1.SplitPoints splitPointForIndexWitTableKey =
9494
SplitPoints.newBuilder()
9595
.setIndex("SingersByFirstLastName")
@@ -98,15 +98,15 @@ static void addSplitPoints(String projectId, String instanceId, String databaseI
9898
com.google.spanner.admin.database.v1.SplitPoints.Key.newBuilder()
9999
.setKeyParts(
100100
ListValue.newBuilder()
101-
.addValues(Value.newBuilder().setStringValue("38").build())
101+
.addValues(Value.newBuilder().setStringValue("Jane").build())
102+
.addValues(Value.newBuilder().setStringValue("Doe").build())
102103
.build()))
103104
.setKeys(
104105
1,
105106
com.google.spanner.admin.database.v1.SplitPoints.Key.newBuilder()
106107
.setKeyParts(
107108
ListValue.newBuilder()
108-
.addValues(Value.newBuilder().setStringValue("Jane").build())
109-
.addValues(Value.newBuilder().setStringValue("Doe").build())
109+
.addValues(Value.newBuilder().setStringValue("38").build())
110110
.build()))
111111
.build();
112112

0 commit comments

Comments
 (0)