@@ -495,8 +495,8 @@ private void testTransport(String query, IndexHints expectedHints)
495
495
public void testLegacyIndexWithAllowFiltering () throws Throwable
496
496
{
497
497
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v1 int, v2 int, v3 int)" );
498
- String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1)" );
499
- String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2)" );
498
+ String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1) USING 'legacy_local_table' " );
499
+ String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2) USING 'legacy_local_table' " );
500
500
501
501
String insert = "INSERT INTO %s (k, v1, v2, v3) VALUES (?, ?, ?, ?)" ;
502
502
Object [] row1 = new Object []{ 1 , 0 , 1 , 1 };
@@ -564,8 +564,8 @@ public void testLegacyIndexWithAllowFiltering() throws Throwable
564
564
public void testLegacyIndexWithoutAllowFiltering () throws Throwable
565
565
{
566
566
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v1 int, v2 int, v3 int)" );
567
- String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1)" );
568
- String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2)" );
567
+ String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1) USING 'legacy_local_table' " );
568
+ String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2) USING 'legacy_local_table' " );
569
569
570
570
String insert = "INSERT INTO %s (k, v1, v2, v3) VALUES (?, ?, ?, ?)" ;
571
571
Object [] row1 = new Object []{ 1 , 0 , 1 , 1 };
@@ -634,8 +634,8 @@ public void testLegacyIndexWithoutAllowFiltering() throws Throwable
634
634
public void testSAIWithAllowFiltering () throws Throwable
635
635
{
636
636
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v1 int, v2 int, v3 int)" );
637
- String idx1 = createIndex ("CREATE CUSTOM INDEX idx1 ON %s(v1) USING 'StorageAttachedIndex '" );
638
- String idx2 = createIndex ("CREATE CUSTOM INDEX idx2 ON %s(v2) USING 'StorageAttachedIndex '" );
637
+ String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1) USING 'sai '" );
638
+ String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2) USING 'sai '" );
639
639
640
640
String insert = "INSERT INTO %s (k, v1, v2, v3) VALUES (?, ?, ?, ?)" ;
641
641
Object [] row1 = new Object []{ 1 , 0 , 1 , 1 };
@@ -707,8 +707,8 @@ public void testSAIWithAllowFiltering() throws Throwable
707
707
public void testSAIWithoutAllowFiltering () throws Throwable
708
708
{
709
709
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v1 int, v2 int, v3 int)" );
710
- String idx1 = createIndex ("CREATE CUSTOM INDEX idx1 ON %s(v1) USING 'StorageAttachedIndex '" );
711
- String idx2 = createIndex ("CREATE CUSTOM INDEX idx2 ON %s(v2) USING 'StorageAttachedIndex '" );
710
+ String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1) USING 'sai '" );
711
+ String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2) USING 'sai '" );
712
712
713
713
String insert = "INSERT INTO %s (k, v1, v2, v3) VALUES (?, ?, ?, ?)" ;
714
714
Object [] row1 = new Object []{ 1 , 0 , 1 , 1 };
@@ -779,7 +779,7 @@ public void testSAIWithoutAllowFiltering() throws Throwable
779
779
@ Test
780
780
public void testLegacy ()
781
781
{
782
- testSingletonIndex ("CREATE INDEX %s ON %%s(%s)" );
782
+ testSingletonIndex ("CREATE INDEX %s ON %%s(%s) USING 'legacy_local_table' " );
783
783
}
784
784
785
785
@ Test
@@ -842,9 +842,9 @@ private void testSingletonIndex(String createIndexQuery)
842
842
public void testMixedIndexImplementations ()
843
843
{
844
844
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v1 int, v2 int, v3 int)" );
845
- String idx1 = createIndex ("CREATE CUSTOM INDEX idx1 ON %s(v1) USING 'StorageAttachedIndex '" );
846
- String idx2 = createIndex ("CREATE CUSTOM INDEX idx2 ON %s(v2) USING 'StorageAttachedIndex '" );
847
- String idx3 = createIndex ("CREATE INDEX idx3 ON %s(v3)" );
845
+ String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1) USING 'sai '" );
846
+ String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2) USING 'sai '" );
847
+ String idx3 = createIndex ("CREATE INDEX idx3 ON %s(v3) USING 'legacy_local_table' " );
848
848
849
849
String insert = "INSERT INTO %s (k, v1, v2, v3) VALUES (?, ?, ?, ?)" ;
850
850
Object [] row1 = new Object []{ 1 , 0 , 1 , 1 };
@@ -964,7 +964,7 @@ public void testMultipleIndexesOnSameColumnLegacyAndSASI()
964
964
{
965
965
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v int)" );
966
966
String sasi = createIndex ("CREATE CUSTOM INDEX sasi ON %s(v) USING 'org.apache.cassandra.index.sasi.SASIIndex'" );
967
- String legacy = createIndex ("CREATE INDEX legacy ON %s(v)" );
967
+ String legacy = createIndex ("CREATE INDEX legacy ON %s(v) USING 'legacy_local_table' " );
968
968
969
969
String insert = "INSERT INTO %s (k, v) VALUES (?, ?)" ;
970
970
Object [] row1 = new Object []{ 1 , 1 };
@@ -1005,8 +1005,8 @@ public void testMultipleIndexesOnSameColumnLegacyAndSASI()
1005
1005
public void testMultipleIndexesOnSameColumnLegacyAndSAI ()
1006
1006
{
1007
1007
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v int)" );
1008
- String sai = createIndex ("CREATE CUSTOM INDEX sai ON %s(v) USING 'StorageAttachedIndex '" );
1009
- String legacy = createIndex ("CREATE INDEX legacy ON %s(v)" );
1008
+ String sai = createIndex ("CREATE INDEX sai ON %s(v) USING 'sai '" );
1009
+ String legacy = createIndex ("CREATE INDEX legacy ON %s(v) USING 'legacy_local_table' " );
1010
1010
1011
1011
String insert = "INSERT INTO %s (k, v) VALUES (?, ?)" ;
1012
1012
Object [] row1 = new Object []{ 1 , 0 };
@@ -1028,7 +1028,7 @@ public void testMultipleIndexesOnSameColumnLegacyAndSAI()
1028
1028
public void testMultipleIndexesOnSameColumnSAIAndSASI ()
1029
1029
{
1030
1030
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v int)" );
1031
- String sai = createIndex ("CREATE CUSTOM INDEX sai ON %s(v) USING 'StorageAttachedIndex '" );
1031
+ String sai = createIndex ("CREATE INDEX sai ON %s(v) USING 'sai '" );
1032
1032
String sasi = createIndex ("CREATE CUSTOM INDEX sasi ON %s(v) USING 'org.apache.cassandra.index.sasi.SASIIndex'" );
1033
1033
1034
1034
String insert = "INSERT INTO %s (k, v) VALUES (?, ?)" ;
@@ -1051,8 +1051,8 @@ public void testMultipleIndexesOnSameColumnSAIAndSASI()
1051
1051
public void testDuplicatedHints ()
1052
1052
{
1053
1053
createTable ("CREATE TABLE %s (k int PRIMARY KEY, v1 int, v2 int, v3 int)" );
1054
- String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1)" );
1055
- String idx2 = createIndex ("CREATE CUSTOM INDEX idx2 ON %s(v2) USING 'StorageAttachedIndex '" );
1054
+ String idx1 = createIndex ("CREATE INDEX idx1 ON %s(v1) USING 'legacy_local_table' " );
1055
+ String idx2 = createIndex ("CREATE INDEX idx2 ON %s(v2) USING 'sai '" );
1056
1056
String idx3 = createIndex ("CREATE CUSTOM INDEX idx3 ON %s(v3) USING 'org.apache.cassandra.index.sasi.SASIIndex'" );
1057
1057
1058
1058
assertThatIndexQueryPlanFor ("SELECT * FROM %s WHERE v1=0 WITH included_indexes={idx1,idx1}" ).selects (idx1 );
0 commit comments