-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZDM-606: Support colon operator in fuzzy SAI queries
- Loading branch information
1 parent
f893984
commit 8b6772e
Showing
15 changed files
with
198 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,6 +211,7 @@ operator | |
| '>' | ||
| '>=' | ||
| '!=' | ||
| ':' | ||
; | ||
|
||
// CQL literals | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,8 +122,8 @@ OTHER=107 | |
'>'=15 | ||
'>='=16 | ||
'!='=17 | ||
'{'=18 | ||
'}'=19 | ||
':'=20 | ||
':'=18 | ||
'{'=19 | ||
'}'=20 | ||
'?'=96 | ||
';'=106 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,8 +122,8 @@ OTHER=107 | |
'>'=15 | ||
'>='=16 | ||
'!='=17 | ||
'{'=18 | ||
'}'=19 | ||
':'=20 | ||
':'=18 | ||
'{'=19 | ||
'}'=20 | ||
'?'=96 | ||
';'=106 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package integration_tests | ||
|
||
import ( | ||
"fmt" | ||
"github.com/datastax/zdm-proxy/integration-tests/env" | ||
"github.com/datastax/zdm-proxy/integration-tests/setup" | ||
"github.com/datastax/zdm-proxy/integration-tests/utils" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func TestSaiSelect(t *testing.T) { | ||
if !env.RunCcmTests { | ||
t.Skip("Test requires CCM, set RUN_CCMTESTS env variable to TRUE") | ||
} | ||
if !(env.IsDse && env.CompareServerVersion("6.9") >= 0) { | ||
t.Skip("Test requires DSE 6.9 cluster") | ||
} | ||
|
||
proxyInstance, err := NewProxyInstanceForGlobalCcmClusters() | ||
require.Nil(t, err) | ||
defer proxyInstance.Shutdown() | ||
|
||
originCluster, targetCluster, err := SetupOrGetGlobalCcmClusters() | ||
require.Nil(t, err) | ||
|
||
// Initialize test data | ||
dataIds1 := []string{ | ||
"43bfd159-dede-47bf-a4da-6d446065e618", | ||
"17a424d1-e611-47e2-8bcd-2cec885edf28"} | ||
dataTasks1 := []string{ | ||
"Mile", | ||
"Mission"} | ||
|
||
// Seed originCluster and targetCluster w/ schema and data | ||
setup.SeedData(originCluster.GetSession(), targetCluster.GetSession(), setup.TestTable3, dataIds1, dataTasks1) | ||
|
||
// Connect to proxy as a "client" | ||
proxy, err := utils.ConnectToCluster("127.0.0.1", "", "", 14002) | ||
|
||
if err != nil { | ||
t.Log("Unable to connect to proxy session.") | ||
t.Fatal(err) | ||
} | ||
defer proxy.Close() | ||
|
||
// run query on proxied connection | ||
// use lowercased version of the actual value | ||
itr := proxy.Query(fmt.Sprintf("SELECT * FROM %s.%s where task : 'mile';", setup.TestKeyspace, setup.TestTable3)).Iter() | ||
row := make(map[string]interface{}) | ||
|
||
// Assertions! | ||
require.True(t, itr.MapScan(row)) | ||
task := setup.MapToTask(row) | ||
|
||
setup.AssertEqual(t, "Mile", task.Task) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters