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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]