You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/05 00:37:38 UTC

[GitHub] [doris] stalary commented on a diff in pull request #9895: [Enhancement](DOE) Step1: Fe generates the DSL and is used to explain

stalary commented on code in PR #9895:
URL: https://github.com/apache/doris/pull/9895#discussion_r913307424


##########
fe/fe-core/src/main/java/org/apache/doris/external/elasticsearch/QueryBuilders.java:
##########
@@ -172,19 +183,65 @@ abstract static class QueryBuilder {
          * @throws IOException if IO error occurred
          */
         abstract void toJson(JsonGenerator out) throws IOException;
+
+        /**
+         * Convert query to JSON format and catch error.
+         **/
+        public String toJson() {
+            StringWriter writer = new StringWriter();
+            try {
+                JsonGenerator gen = mapper.getFactory().createGenerator(writer);
+                this.toJson(gen);
+                gen.flush();
+                gen.close();
+            } catch (IOException e) {
+                LOG.warn("QueryBuilder toJson error");

Review Comment:
   Step one, in order to be compatible, fe generate dsl can not affect exist logic, what do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org