Skip to content

Commit 995cf71

Browse files
authored
PHOENIX-7880 addendum (#2509)
1 parent 9477645 commit 995cf71

4 files changed

Lines changed: 35 additions & 34 deletions

File tree

phoenix-core-client/src/main/java/org/apache/phoenix/expression/util/bson/UpdateExpressionUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ private enum UpdateOp {
9898
public static void updateExpression(final BsonDocument updateExpression,
9999
final BsonDocument bsonDocument) {
100100

101-
LOGGER.debug("Update Expression: {} , current bsonDocument: {}", updateExpression, bsonDocument);
101+
LOGGER.debug("Update Expression: {} , current bsonDocument: {}", updateExpression,
102+
bsonDocument);
102103

103104
if (updateExpression.containsKey("$SET")) {
104105
executeSetExpression((BsonDocument) updateExpression.get("$SET"), bsonDocument);

phoenix-core/src/it/java/org/apache/phoenix/end2end/Bson3IT.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ public void testBsonOpsWithSqlConditionsUpdateSuccess() throws Exception {
232232
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
233233
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
234234
.append("track[0].shot[2][0].city.problem[2]",
235-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
236-
new BsonString("track[0].shot[2][0].city.problem[2]"),
237-
new BsonDouble(529.435))))))
235+
new BsonDocument().append("$ADD",
236+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
237+
new BsonDouble(529.435))))))
238238
.append("$UNSET",
239239
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
240240

@@ -766,9 +766,9 @@ public void testBsonOpsWithDocumentConditionsUpdateSuccess() throws Exception {
766766
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
767767
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
768768
.append("track[0].shot[2][0].city.problem[2]",
769-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
770-
new BsonString("track[0].shot[2][0].city.problem[2]"),
771-
new BsonDouble(529.435))))))
769+
new BsonDocument().append("$ADD",
770+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
771+
new BsonDouble(529.435))))))
772772
.append("$UNSET",
773773
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
774774

@@ -1167,9 +1167,9 @@ public void testBsonOpsWithSqlConditionsUpdateFailure() throws Exception {
11671167
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
11681168
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
11691169
.append("track[0].shot[2][0].city.problem[2]",
1170-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
1171-
new BsonString("track[0].shot[2][0].city.problem[2]"),
1172-
new BsonDouble(529.435))))))
1170+
new BsonDocument().append("$ADD",
1171+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
1172+
new BsonDouble(529.435))))))
11731173
.append("$UNSET",
11741174
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
11751175

@@ -1542,9 +1542,9 @@ public void testBsonOpsWithDocumentConditionsUpdateFailure() throws Exception {
15421542
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
15431543
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
15441544
.append("track[0].shot[2][0].city.problem[2]",
1545-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
1546-
new BsonString("track[0].shot[2][0].city.problem[2]"),
1547-
new BsonDouble(529.435))))))
1545+
new BsonDocument().append("$ADD",
1546+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
1547+
new BsonDouble(529.435))))))
15481548
.append("$UNSET",
15491549
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
15501550

@@ -1959,9 +1959,9 @@ public void testBsonOpsWithSqlConditionsUpdateSuccessWithTTL() throws Exception
19591959
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
19601960
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
19611961
.append("track[0].shot[2][0].city.problem[2]",
1962-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
1963-
new BsonString("track[0].shot[2][0].city.problem[2]"),
1964-
new BsonDouble(529.435))))))
1962+
new BsonDocument().append("$ADD",
1963+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
1964+
new BsonDouble(529.435))))))
19651965
.append("$UNSET",
19661966
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
19671967

phoenix-core/src/it/java/org/apache/phoenix/end2end/Bson4IT.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,9 @@ public void testConditionalUpsertReturnRow() throws Exception {
642642
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
643643
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
644644
.append("track[0].shot[2][0].city.problem[2]",
645-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
646-
new BsonString("track[0].shot[2][0].city.problem[2]"),
647-
new BsonDouble(529.435))))))
645+
new BsonDocument().append("$ADD",
646+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
647+
new BsonDouble(529.435))))))
648648
.append("$UNSET",
649649
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
650650

@@ -728,9 +728,9 @@ public void testConditionalUpsertReturnRow() throws Exception {
728728
.append("new_field1", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
729729
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft_new_val"))
730730
.append("track[0].shot[2][0].city.problem[2]",
731-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
732-
new BsonString("track[0].shot[2][0].city.problem[2]"),
733-
new BsonInt32(123))))));
731+
new BsonDocument().append("$ADD",
732+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
733+
new BsonInt32(123))))));
734734

735735
stmt = conn.prepareStatement(
736736
"UPSERT INTO " + tableName + " VALUES (?) ON DUPLICATE KEY UPDATE COL = CASE WHEN"
@@ -832,9 +832,9 @@ public void testConditionalUpsertReturnOldRow() throws Exception {
832832
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
833833
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
834834
.append("track[0].shot[2][0].city.problem[2]",
835-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
836-
new BsonString("track[0].shot[2][0].city.problem[2]"),
837-
new BsonDouble(529.435))))))
835+
new BsonDocument().append("$ADD",
836+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
837+
new BsonDouble(529.435))))))
838838
.append("$UNSET",
839839
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
840840

@@ -914,9 +914,9 @@ public void testConditionalUpsertReturnOldRow() throws Exception {
914914
.append("new_field1", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
915915
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft_new_val"))
916916
.append("track[0].shot[2][0].city.problem[2]",
917-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
918-
new BsonString("track[0].shot[2][0].city.problem[2]"),
919-
new BsonInt32(123))))));
917+
new BsonDocument().append("$ADD",
918+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
919+
new BsonInt32(123))))));
920920

921921
stmt = conn.prepareStatement(
922922
"UPSERT INTO " + tableName + " VALUES (?) ON DUPLICATE KEY UPDATE_ONLY COL = CASE WHEN"

phoenix-core/src/it/java/org/apache/phoenix/end2end/Bson5IT.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ public void testBsonOpsWithSqlConditionsUpdateSuccess() throws Exception {
252252
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
253253
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
254254
.append("track[0].shot[2][0].city.problem[2]",
255-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
256-
new BsonString("track[0].shot[2][0].city.problem[2]"),
257-
new BsonDouble(529.435))))))
255+
new BsonDocument().append("$ADD",
256+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
257+
new BsonDouble(529.435))))))
258258
.append("$UNSET",
259259
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
260260

@@ -489,9 +489,9 @@ public void testBsonOpsWithSqlConditionsUpdateFailure() throws Exception {
489489
.append("browserling", new BsonBinary(PDouble.INSTANCE.toBytes(-505169340.54880095)))
490490
.append("track[0].shot[2][0].city.standard[5]", new BsonString("soft"))
491491
.append("track[0].shot[2][0].city.problem[2]",
492-
new BsonDocument().append("$ADD", new BsonArray(Arrays.asList(
493-
new BsonString("track[0].shot[2][0].city.problem[2]"),
494-
new BsonDouble(529.435))))))
492+
new BsonDocument().append("$ADD",
493+
new BsonArray(Arrays.asList(new BsonString("track[0].shot[2][0].city.problem[2]"),
494+
new BsonDouble(529.435))))))
495495
.append("$UNSET",
496496
new BsonDocument().append("track[0].shot[2][0].city.flame", new BsonNull()));
497497

0 commit comments

Comments
 (0)