>From Murtadha Hubail <[email protected]>: Murtadha Hubail has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17451 )
Change subject: [ASTERIXDB-3156][API] Allow specifying lossless-adm as format ...................................................................... [ASTERIXDB-3156][API] Allow specifying lossless-adm as format - user model changes: yes - storage format changes: no - interface changes: no Details: - Allow specifying `lossless-adm` as format in the REST API. - Add test case. Change-Id: I24057c56bafbe021b5d4da93a82cdaa0213bccd5 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17451 Integration-Tests: Jenkins <[email protected]> Reviewed-by: Ali Alsuliman <[email protected]> Tested-by: Jenkins <[email protected]> --- M asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceRequestParameters.java A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/api/request-param/request-param.003.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/results/api/request-param/request-param.003.adm 3 files changed, 51 insertions(+), 0 deletions(-) Approvals: Ali Alsuliman: Looks good to me, approved Jenkins: Verified; Verified Anon. E. Moose #1000171: diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceRequestParameters.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceRequestParameters.java index df068c0..b6913e4 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceRequestParameters.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceRequestParameters.java @@ -626,6 +626,8 @@ return Pair.of(OutputFormat.CLEAN_JSON, Boolean.FALSE); } else if (value.equals(HttpUtil.ContentType.ADM)) { return Pair.of(OutputFormat.ADM, Boolean.FALSE); + } else if (value.equals(Attribute.LOSSLESS_ADM.str())) { + return Pair.of(OutputFormat.LOSSLESS_ADM_JSON, Boolean.FALSE); } else { throw new RuntimeDataException(ErrorCode.INVALID_REQ_PARAM_VAL, parameterName, value); } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/api/request-param/request-param.003.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/api/request-param/request-param.003.query.sqlpp new file mode 100644 index 0000000..52800c8 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/api/request-param/request-param.003.query.sqlpp @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// requesttype=application/json +// param format:string=lossless-adm + +from [1, 2] as v +select v; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/request-param/request-param.003.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/request-param/request-param.003.adm new file mode 100644 index 0000000..cb88308 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/request-param/request-param.003.adm @@ -0,0 +1,2 @@ +{ "v": 1 } +{ "v": 2 } \ No newline at end of file -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17451 To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I24057c56bafbe021b5d4da93a82cdaa0213bccd5 Gerrit-Change-Number: 17451 Gerrit-PatchSet: 2 Gerrit-Owner: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-MessageType: merged
