zemin-piao commented on issue #11909:
URL: https://github.com/apache/druid/issues/11909#issuecomment-981116713
> In json, it would look like this:
>
> ```
> {
> "query":"SELECT sum(\"count\") ..."
> }
> ```
>
> Hope this resolves the issue.
As I mentioned, Slash + double quote does not work. So naming columns using
SQL keywords is strongly not recommended. Will look into the project and
debug a bit to start to get familiar with Druid.
Double quote:
```python
import requests
url = "http://localhost:8082/druid/v2/sql"
headers = {"Content-Type": "application/json"}
sql_json_for_query = """
{"query": "select sum(\"count\") from wikipedia"}
"""
requests.post(url, sql_json_for_query, headers=headers).text
```
```
'<html>\n<head>\n<meta http-equiv="Content-Type"
content="text/html;charset=utf-8"/>\n<title>Error 500
javax.servlet.ServletException: com.fasterxml.jackson.core.JsonParseException:
Unexpected character ('c' (code 99)): was expecting comma to separate
Object entries\n
```
--
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]