When using Livy to interact with spark. Spark sql with Chinese character always return empty result.
The reason is because Zeppelin use restTemplate.java from spring frame work. When sending restful request to Livy, the headers is defined as Content-Type：application/json. This setting doesn't specify the encoding of the charset and spring will use ISO-8895-1 by default. But ISO-8895-1 isn't compatible with Chinese. The code Livy receive from Zeppelin contain invalid Chinese encoding and will be interpret by spark as ?.
Change header from application/json to MediaType.APPLICATION_JSON_UTF8_VALUE in BaseLivyInterpreter.java and rebuild can solve this problem.
It seems encoding problem affect more than Chinese since ISO-8895-1's coverage is restricted. I think update the encoding to UTF-8 would be helpful.