gianm commented on a change in pull request #6302: Add SQL id, request logs,
and metrics
URL: https://github.com/apache/incubator-druid/pull/6302#discussion_r246157958
##########
File path: server/src/main/java/org/apache/druid/server/RequestLogLine.java
##########
@@ -58,10 +78,12 @@ public String getLine(ObjectMapper objectMapper) throws
JsonProcessingException
);
}
- @JsonProperty("timestamp")
- public DateTime getTimestamp()
+ public String getSqlQueryLine(ObjectMapper objectMapper) throws
JsonProcessingException
Review comment:
Alternatively, this:
```java
return JOINER.join(
Arrays.asList(
timestamp,
remoteAddr,
"",
objectMapper.writeValueAsString(queryStats),
objectMapper.writeValueAsString(ImmutableMap.of("sql", sql))
)
);
```
It leaves the native-query field blank, and adds a new field on the end of
the TSV for sql query. It uses a JSON object rather than emitting the SQL as-is
for two reasons: (1) we can extend with more info later if we want; (2) the SQL
query might have newlines and such in it, and the
`objectMapper.writeValueAsString` will get rid of those.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]