Skip to content

Commit 1fddeea

Browse files
authored
fix: add equals to ASToptions_clause (#138)
Fixes #117
1 parent 6c42a77 commit 1fddeea

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/main/java/com/google/cloud/solutions/spannerddl/parser/ASToptions_clause.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ public Map<String, String> getKeyValueMap() {
4242
return AstTreeUtils.getChildrenAssertType(children, ASToption_key_val.class).stream()
4343
.collect(Collectors.toMap(ASToption_key_val::getKey, ASToption_key_val::getValue));
4444
}
45+
46+
@Override
47+
public boolean equals(Object obj) {
48+
return toString().equals(obj.toString());
49+
}
4550
}

src/test/resources/newDdl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ STORING (scol1, scol3);
493493

494494
CREATE SEARCH INDEX AlbumsIndex
495495
ON Albums (col1, col2, col3)
496+
OPTIONS (sort_order_sharding=TRUE)
496497

497498
== TEST 59 Add stored col to search index
498499

@@ -506,4 +507,3 @@ CREATE SEARCH INDEX AlbumsIndex
506507
ON Albums (col1, col2)
507508

508509
==
509-

src/test/resources/originalDdl.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ CREATE SEARCH INDEX AlbumsIndex ON Albums ( AlbumTitle_Tokens ASC, Rating_Tokens
481481

482482
== TEST 57 Changing search index - before and after table changes
483483

484-
create table test1 ( col1 int64, col2 int64 ) primary key (col1);
484+
create table test1 ( col1 int64, col2 int64 ) primary key (col1) ;
485485

486486
CREATE SEARCH INDEX AlbumsIndex
487487
ON Albums (col1, col2)
@@ -491,6 +491,7 @@ STORING (scol1, scol2);
491491

492492
CREATE SEARCH INDEX AlbumsIndex
493493
ON Albums (col1, col2)
494+
OPTIONS (sort_order_sharding=TRUE)
494495

495496
== TEST 59 Add stored col to search index
496497

@@ -504,8 +505,3 @@ ON Albums (col1, col2)
504505
STORING (scol1)
505506

506507
==
507-
508-
509-
510-
511-

0 commit comments

Comments
 (0)