-
Notifications
You must be signed in to change notification settings - Fork 181
Move Calcite-only tests from CrossClusterSearchIT to CalciteCrossClusterSearchIT #5085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,4 +349,74 @@ public void testCrossClusterRexWithOffsetField() throws IOException { | |
| verifyDataRows( | ||
| result, rows("Duke Willmington", "u", "vowel=1-1"), rows("Bond", "o", "vowel=1-1")); | ||
| } | ||
|
|
||
| @Test | ||
| public void testCrossClusterAddTotals() throws IOException { | ||
| JSONObject result = | ||
| executeQuery( | ||
| String.format( | ||
| "search source=%s| sort 1 age | fields firstname, age | addtotals age", | ||
| TEST_INDEX_BANK_REMOTE)); | ||
| verifyDataRows(result, rows("Nanette", 28, 28)); | ||
| } | ||
|
|
||
| /** CrossClusterSearchIT Test for addcoltotals. */ | ||
| @Test | ||
| public void testCrossClusterAddColTotals() throws IOException { | ||
| JSONObject result = | ||
| executeQuery( | ||
| String.format( | ||
| "search source=%s | where firstname='Hattie' or firstname ='Nanette'|fields" | ||
| + " firstname,age,balance | addcoltotals age balance", | ||
| TEST_INDEX_BANK_REMOTE)); | ||
| verifyDataRows( | ||
| result, rows("Hattie", 36, 5686), rows("Nanette", 28, 32838), rows(null, 64, 38524)); | ||
| } | ||
|
|
||
| @Test | ||
| public void testCrossClusterTranspose() throws IOException { | ||
| JSONObject result = | ||
| executeQuery( | ||
| String.format( | ||
| "search source=%s | where firstname='Hattie' or firstname ='Nanette' or" | ||
| + " firstname='Dale'|sort firstname desc |fields firstname,age,balance |" | ||
| + " transpose 3 column_name='column_names'", | ||
| TEST_INDEX_BANK_REMOTE)); | ||
|
|
||
| verifyDataRows( | ||
| result, | ||
| rows("firstname", "Nanette", "Hattie", "Dale"), | ||
| rows("balance", "32838", "5686", "4180"), | ||
| rows("age", "28", "36", "33")); | ||
| } | ||
|
|
||
| @Test | ||
| public void testCrossClusterAppend() throws IOException { | ||
| JSONObject result = | ||
| executeQuery( | ||
| String.format( | ||
| "search source=%s | stats count() as cnt by gender | append [ search source=%s |" | ||
| + " stats count() as cnt ]", | ||
| TEST_INDEX_BANK_REMOTE, TEST_INDEX_BANK_REMOTE)); | ||
| verifyDataRows(result, rows(3, "F"), rows(4, "M"), rows(7, null)); | ||
| } | ||
|
|
||
| /** CrossClusterSearchIT Test for mvcombine. */ | ||
| @Test | ||
| public void testCrossClusterMvcombine() throws IOException { | ||
|
|
||
| JSONObject result = | ||
| executeQuery( | ||
| String.format( | ||
| "search source=%s | where firstname='Hattie' or firstname='Nanette' " | ||
| + "| fields firstname, age | mvcombine age", | ||
| TEST_INDEX_BANK_REMOTE)); | ||
|
|
||
| verifyColumn(result, columnName("firstname"), columnName("age")); | ||
|
|
||
| verifyDataRows( | ||
| result, | ||
| rows("Hattie", new org.json.JSONArray().put(36)), | ||
| rows("Nanette", new org.json.JSONArray().put(28))); | ||
| } | ||
|
Comment on lines
+353
to
+421
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add null/invalid/boundary coverage (or point to existing coverage) for these new Calcite cross-cluster tests. As per coding guidelines: “NULL input tests must be included for all new functions”, “Include boundary condition tests (min/max values, empty inputs) for all new functions”, “Include error condition tests (invalid inputs, exceptions) for all new functions”, and “Include multi-document tests for per-document operations”. 🤖 Prompt for AI Agents |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.