-
Notifications
You must be signed in to change notification settings - Fork 186
Add CSV formatter in new engine #870
Add CSV formatter in new engine #870
Conversation
# Conflicts: # legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSQLQueryAction.java
Codecov Report
@@ Coverage Diff @@
## develop #870 +/- ##
===========================================
Coverage 99.85% 99.86%
- Complexity 2148 2217 +69
===========================================
Files 216 225 +9
Lines 4850 5129 +279
Branches 320 336 +16
===========================================
+ Hits 4843 5122 +279
Misses 5 5
Partials 2 2 Continue to review full report at Codecov.
|
Could you add the following related issue to the description? I think we should be able to close them after this PR merged. |
Added but the last issue #546 because this PR didn't enable custom separators yet |
...rc/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSQLQueryAction.java
Outdated
Show resolved
Hide resolved
legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSqlAction.java
Outdated
Show resolved
Hide resolved
...com/amazon/opendistroforelasticsearch/sql/protocol/response/format/CsvResponseFormatter.java
Outdated
Show resolved
Hide resolved
Got it, you can close that one once this merged. Thanks! |
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.
Thanks for the changes!
...rc/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSQLQueryAction.java
Outdated
Show resolved
Hide resolved
...com/amazon/opendistroforelasticsearch/sql/protocol/response/format/CsvResponseFormatter.java
Show resolved
Hide resolved
...com/amazon/opendistroforelasticsearch/sql/protocol/response/format/CsvResponseFormatter.java
Outdated
Show resolved
Hide resolved
* support csv format in new engine * skipped some IT cases that are not applicable in new engine * udpate * added escape option * added test for Format * update * update * added IT for ppl * added IT for ppl * added IT for ppl * added license header * added test for sql * added example in protocol doc * addressed comments * added responseParams override method to sql and ppl stats actions * added unit test cases * update * addressed comment * addressed comments
* support csv format in new engine * skipped some IT cases that are not applicable in new engine * udpate * added escape option * added test for Format * update * update * added IT for ppl * added IT for ppl * added IT for ppl * added license header * added test for sql * added example in protocol doc * addressed comments * added responseParams override method to sql and ppl stats actions * added unit test cases * update * addressed comment * addressed comments
Issue #, if available:
#148 #117 #100
Description of changes:
Added csv formatter
CsvResponseFormatter
in new engine. The formatter formats theQueryResult
to csv format and by default it sanitizes the result by (1) inserting single-quote in front of header/data if it starts with special characters including+
,-
,=
and@
; (2) quoting the header/data if one or more commas (,
) in the header/data. The sanitizing can be skipped by adding ansanitize
param and set it tofalse
value in the request.User manual updates: https://github.com/chloe-zh/sql/blob/csv-formatter/docs/user/interfaces/protocol.rst
Added tests for the formatter; ignored a couple of legacy tests that are not applicable for the new engine
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.