You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2019/04/19 02:57:24 UTC

[incubator-pinot] branch master updated: fix non-engish field value gibberish (#4128)

This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 8775352  fix non-engish field value gibberish (#4128)
8775352 is described below

commit 8775352a18b8839fda1a79949b677e368b7d7364
Author: Sunny <92...@qq.com>
AuthorDate: Fri Apr 19 10:57:20 2019 +0800

    fix non-engish field value gibberish (#4128)
---
 .../org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pinot-api/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java b/pinot-api/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
index 7c99d99..2c02357 100644
--- a/pinot-api/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
+++ b/pinot-api/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
@@ -58,7 +58,9 @@ class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
 
       final String url = "http://" + brokerAddress + "/query";
 
-      final Future<Response> response = _httpClient.preparePost(url).setBody(json.toString()).execute();
+      final Future<Response> response = _httpClient.preparePost(url)
+          .addHeader("Content-Type", "application/json; charset=utf-8")
+          .setBody(json.toString()).execute();
 
       return new BrokerResponseFuture(response, query, url);
     } catch (Exception e) {
@@ -113,7 +115,7 @@ class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
               "Pinot returned HTTP status " + httpResponse.getStatusCode() + ", expected 200");
         }
 
-        String responseBody = httpResponse.getResponseBody();
+        String responseBody = httpResponse.getResponseBody("UTF-8");
         return BrokerResponse.fromJson(OBJECT_READER.readTree(responseBody));
       } catch (Exception e) {
         throw new ExecutionException(e);


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