-
Notifications
You must be signed in to change notification settings - Fork 141
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
Adding PPL GET Api endpoint #2464
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
611aa7e
add 2.11 release notes
YANG-DB 2b4ab28
add 2.11 release notes
YANG-DB 61f96c8
update notes
YANG-DB cd147d4
Merge branch 'opensearch-project:main' into main
YANG-DB 7eb2f9e
Merge branch 'opensearch-project:main' into main
YANG-DB 7b2fa89
fix spotlessApply issues
YANG-DB 4e3f53a
fix failed tests
YANG-DB 07904be
remove redundant Prometheus IT test
YANG-DB 6780ef2
Merge branch 'opensearch-project:main' into main
YANG-DB 917b841
remove un-needed grammar from 2.X version
YANG-DB 889b5b2
Merge branch 'main' into ppl-get-api-endpoint
YANG-DB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
integ-test/src/test/java/org/opensearch/sql/ppl/ConvertTZFunctionWithGetIT.java
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,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import static org.opensearch.rest.RestRequest.Method.GET; | ||
|
||
import java.io.IOException; | ||
|
||
/** Run ConvertTZFunctionIT tests using http GET request */ | ||
public class ConvertTZFunctionWithGetIT extends ConvertTZFunctionIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/DataTypeWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run DataTypeIT tests using http GET request */ | ||
public class DataTypeWithGetIT extends DataTypeIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
integ-test/src/test/java/org/opensearch/sql/ppl/DateTimeComparisonWithGetIT.java
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,22 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run DateTimeComparisonIT tests using http GET request */ | ||
public class DateTimeComparisonWithGetIT extends DateTimeComparisonIT { | ||
public DateTimeComparisonWithGetIT(String functionCall, String name, Boolean expectedResult) { | ||
super(functionCall, name, expectedResult); | ||
} | ||
|
||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/DateTimeFunctionWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run DateTimeFunctionIT tests using http GET request */ | ||
public class DateTimeFunctionWithGetIT extends DateTimeFunctionIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/DateTimeImplementationWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run DateTimeImplementationIT tests using http GET request */ | ||
public class DateTimeImplementationWithGetIT extends DateTimeImplementationIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/DedupCommandWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run DedupCommandIT tests using http GET request */ | ||
public class DedupCommandWithGetIT extends DedupCommandIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/DescribeCommandWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run DescribeCommandIT tests using http GET request */ | ||
public class DescribeCommandWithGetIT extends DescribeCommandIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/ExplainWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run ExplainIT tests using http GET request */ | ||
public class ExplainWithGetIT extends ExplainIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/FieldsCommandWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run FieldsCommandIT tests using http GET request */ | ||
public class FieldsCommandWithGetIT extends FieldsCommandIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/HeadCommandWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run HeadCommandIT tests using http GET request */ | ||
public class HeadCommandWithGetIT extends HeadCommandIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/LegacyAPICompatibilityWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run LegacyAPICompatibilityIT tests using http GET request */ | ||
public class LegacyAPICompatibilityWithGetIT extends LegacyAPICompatibilityIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/LikeQueryWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run LikeQueryIT tests using http GET request */ | ||
public class LikeQueryWithGetIT extends LikeQueryIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/MatchBoolPrefixWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run MatchBoolPrefixIT tests using http GET request */ | ||
public class MatchBoolPrefixWithGetIT extends MatchBoolPrefixIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/MatchPhrasePrefixWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run MatchPhrasePrefixIT tests using http GET request */ | ||
public class MatchPhrasePrefixWithGetIT extends MatchPhrasePrefixIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/MatchPhraseWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run MatchPhraseIT tests using http GET request */ | ||
public class MatchPhraseWithGetIT extends MatchPhraseIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/MatchWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run MatchIT tests using http GET request */ | ||
public class MatchWithGetIT extends MatchIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
integ-test/src/test/java/org/opensearch/sql/ppl/MathematicalFunctionWithGetIT.java
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import java.io.IOException; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run MathematicalFunctionIT tests using http GET request */ | ||
public class MathematicalFunctionWithGetIT extends MathematicalFunctionIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
integ-test/src/test/java/org/opensearch/sql/ppl/MetricsWithGetIT.java
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,17 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run MetricsIT tests using http GET request */ | ||
public class MetricsWithGetIT extends MetricsIT { | ||
@Override | ||
public void init() throws Exception { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
integ-test/src/test/java/org/opensearch/sql/ppl/MultiMatchWithGetIT.java
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,31 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.sql.ppl; | ||
|
||
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BEER; | ||
|
||
import java.io.IOException; | ||
import org.junit.Test; | ||
import org.opensearch.rest.RestRequest; | ||
|
||
/** Run MultiMatchIT tests using http GET request */ | ||
public class MultiMatchWithGetIT extends MultiMatchIT { | ||
@Override | ||
public void init() throws IOException { | ||
super.init(); | ||
this.method = RestRequest.Method.GET; | ||
} | ||
|
||
@Test | ||
public void test_multi_match() throws IOException { | ||
String query = | ||
"SOURCE=" | ||
+ TEST_INDEX_BEER | ||
+ " | WHERE multi_match(['Tags' ^ 1.5, Title, 'Body' 4.2], 'taste') | fields Id"; | ||
var result = executeQuery(query); | ||
assertEquals(16, result.getInt("total")); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand why there are a lot of these mini classes that just change the method. My understanding is it's trying to subtly change the extended test with a new method, but I'm not sure I follow why this is better than adding more tests to the base test class that use different methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just the easiest way in java to separate different aspects of the test into different classes - each class is responsible for one thing - the "single responsibility" principle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add GET api test in each IT? E.g. DedupCommandIT is focus on IntegrationTest instead of dedup command test, instead of REST interface.
Add
GET API
in doc test (endpoint.rst) should be enough?