Skip to content

Commit f750bc6

Browse files
authored
[v3.0.0] Deprecate OpenSearch DSL format (#3367)
* mark places to change Signed-off-by: Sean Kao <seankao@amazon.com> * remove dsl format from doc Signed-off-by: Sean Kao <seankao@amazon.com> * remove Format.JSON Signed-off-by: Sean Kao <seankao@amazon.com> * fix test case wip Signed-off-by: Sean Kao <seankao@amazon.com> * Revert "fix test case wip" This reverts commit e3157aa. Signed-off-by: Sean Kao <seankao@amazon.com> * ignore legacy test using json response format Signed-off-by: Sean Kao <seankao@amazon.com> * spotlessApply Signed-off-by: Sean Kao <seankao@amazon.com> * remove json param check in executeRequest Signed-off-by: Sean Kao <seankao@amazon.com> * fix getScriptFieldFromQuery can't get requestBuilder from QueryPlan Signed-off-by: Sean Kao <seankao@amazon.com> * spotlessApply Signed-off-by: Sean Kao <seankao@amazon.com> * ignore test using json Signed-off-by: Sean Kao <seankao@amazon.com> * fix test case Signed-off-by: Sean Kao <seankao@amazon.com> * ignore legacy tests affected Signed-off-by: Sean Kao <seankao@amazon.com> * fix json call Signed-off-by: Sean Kao <seankao@amazon.com> * remove patch file Signed-off-by: Sean Kao <seankao@amazon.com> * comment Signed-off-by: Sean Kao <seankao@amazon.com> * remove unneeded file Signed-off-by: Sean Kao <seankao@amazon.com> * delete unused class Signed-off-by: Sean Kao <seankao@amazon.com> * revert change in prod code for test purpose; fix test Signed-off-by: Sean Kao <seankao@amazon.com> * re-evaluate affected tests Signed-off-by: Sean Kao <seankao@amazon.com> * spotlessApply Signed-off-by: Sean Kao <seankao@amazon.com> --------- Signed-off-by: Sean Kao <seankao@amazon.com>
1 parent 482c681 commit f750bc6

32 files changed

+98
-270
lines changed

docs/user/interfaces/protocol.rst

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -208,73 +208,6 @@ Result set::
208208
"status" : 400
209209
}
210210

211-
OpenSearch DSL
212-
==============
213-
214-
Description
215-
-----------
216-
217-
The plugin returns original response from OpenSearch in JSON. Because this is the native response from OpenSearch, extra efforts are needed to parse and interpret it.
218-
219-
Example
220-
-------
221-
222-
SQL query::
223-
224-
>> curl -H 'Content-Type: application/json' -X POST localhost:9200/_plugins/_sql?format=json -d '{
225-
"query" : "SELECT firstname, lastname, age FROM accounts ORDER BY age LIMIT 2"
226-
}'
227-
228-
Result set::
229-
230-
{
231-
"_shards" : {
232-
"total" : 5,
233-
"failed" : 0,
234-
"successful" : 5,
235-
"skipped" : 0
236-
},
237-
"hits" : {
238-
"hits" : [
239-
{
240-
"_index" : "accounts",
241-
"_type" : "_doc",
242-
"_source" : {
243-
"firstname" : "Nanette",
244-
"age" : 28,
245-
"lastname" : "Bates"
246-
},
247-
"_id" : "13",
248-
"sort" : [
249-
28
250-
],
251-
"_score" : null
252-
},
253-
{
254-
"_index" : "accounts",
255-
"_type" : "_doc",
256-
"_source" : {
257-
"firstname" : "Amber",
258-
"age" : 32,
259-
"lastname" : "Duke"
260-
},
261-
"_id" : "1",
262-
"sort" : [
263-
32
264-
],
265-
"_score" : null
266-
}
267-
],
268-
"total" : {
269-
"value" : 4,
270-
"relation" : "eq"
271-
},
272-
"max_score" : null
273-
},
274-
"took" : 100,
275-
"timed_out" : false
276-
}
277-
278211
CSV Format
279212
==========
280213

integ-test/src/test/java/org/opensearch/sql/legacy/AggregationIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
import org.junit.Ignore;
3939
import org.junit.Test;
4040

41+
@Ignore(
42+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
43+
+ " response for now. Need to decide what to do with these test cases.")
4144
public class AggregationIT extends SQLIntegTestCase {
4245

4346
@Override

integ-test/src/test/java/org/opensearch/sql/legacy/DateFormatIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
import org.junit.Test;
3030
import org.opensearch.sql.legacy.exception.SqlParseException;
3131

32+
@Ignore(
33+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
34+
+ " response for now. Need to decide what to do with these test cases.")
3235
public class DateFormatIT extends SQLIntegTestCase {
3336

3437
private static final String SELECT_FROM =

integ-test/src/test/java/org/opensearch/sql/legacy/DateFunctionsIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.joda.time.format.DateTimeFormat;
1818
import org.joda.time.format.DateTimeFormatter;
1919
import org.json.JSONObject;
20+
import org.junit.Ignore;
2021
import org.junit.Test;
2122
import org.opensearch.action.search.SearchResponse;
2223
import org.opensearch.common.xcontent.LoggingDeprecationHandler;
@@ -25,6 +26,9 @@
2526
import org.opensearch.core.xcontent.XContentParser;
2627
import org.opensearch.search.SearchHit;
2728

29+
@Ignore(
30+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
31+
+ " response for now. Need to decide what to do with these test cases.")
2832
public class DateFunctionsIT extends SQLIntegTestCase {
2933

3034
private static final String FROM = "FROM " + TestsConstants.TEST_INDEX_ONLINE;

integ-test/src/test/java/org/opensearch/sql/legacy/GetEndpointQueryIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.junit.rules.ExpectedException;
1414
import org.opensearch.client.ResponseException;
1515

16-
/** Tests to cover requests with "?format=csv" parameter */
1716
public class GetEndpointQueryIT extends SQLIntegTestCase {
1817

1918
@Rule public final ExpectedException rule = ExpectedException.none();

integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@
1919
import org.json.JSONArray;
2020
import org.json.JSONObject;
2121
import org.junit.Assert;
22+
import org.junit.Ignore;
2223
import org.junit.Test;
2324

2425
/** Test new hash join algorithm by comparison with old implementation. */
26+
@Ignore(
27+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
28+
+ " response for now. Need to decide what to do with these test cases.")
2529
public class HashJoinIT extends SQLIntegTestCase {
2630

2731
/** Hint to use old join algorithm */

integ-test/src/test/java/org/opensearch/sql/legacy/HavingIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020
import org.hamcrest.Matcher;
2121
import org.json.JSONArray;
2222
import org.json.JSONObject;
23+
import org.junit.Ignore;
2324
import org.junit.Test;
2425

26+
@Ignore(
27+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
28+
+ " response for now. Need to decide what to do with these test cases.")
2529
public class HavingIT extends SQLIntegTestCase {
2630

2731
private static final String SELECT_FROM_WHERE_GROUP_BY =

integ-test/src/test/java/org/opensearch/sql/legacy/JSONRequestIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.io.IOException;
1515
import java.util.Map;
1616
import org.json.JSONObject;
17+
import org.junit.Ignore;
1718
import org.junit.Test;
1819
import org.opensearch.action.search.SearchResponse;
1920
import org.opensearch.common.xcontent.LoggingDeprecationHandler;
@@ -23,6 +24,9 @@
2324
import org.opensearch.search.SearchHit;
2425
import org.opensearch.search.SearchHits;
2526

27+
@Ignore(
28+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
29+
+ " response for now. Need to decide what to do with these test cases.")
2630
public class JSONRequestIT extends SQLIntegTestCase {
2731

2832
@Override

integ-test/src/test/java/org/opensearch/sql/legacy/JoinIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
import org.junit.Ignore;
3232
import org.junit.Test;
3333

34+
@Ignore(
35+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
36+
+ " response for now. Need to decide what to do with these test cases.")
3437
public class JoinIT extends SQLIntegTestCase {
3538

3639
private static final String USE_NL_HINT = " /*! USE_NL*/";

integ-test/src/test/java/org/opensearch/sql/legacy/MathFunctionsIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import com.fasterxml.jackson.core.JsonFactory;
1414
import java.io.IOException;
15+
import org.junit.Ignore;
1516
import org.junit.Test;
1617
import org.opensearch.action.search.SearchResponse;
1718
import org.opensearch.common.xcontent.LoggingDeprecationHandler;
@@ -20,6 +21,9 @@
2021
import org.opensearch.core.xcontent.XContentParser;
2122
import org.opensearch.search.SearchHit;
2223

24+
@Ignore(
25+
"OpenSearch DSL format is deprecated in 3.0.0. Ignore legacy IT that relies on json format"
26+
+ " response for now. Need to decide what to do with these test cases.")
2327
public class MathFunctionsIT extends SQLIntegTestCase {
2428

2529
private static final String FROM = "FROM " + TestsConstants.TEST_INDEX_ACCOUNT;

0 commit comments

Comments
 (0)