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_r246160808
 
 

 ##########
 File path: sql/src/main/java/org/apache/druid/sql/http/SqlResource.java
 ##########
 @@ -81,16 +85,21 @@ public Response doPost(
       @Context final HttpServletRequest req
   ) throws IOException
   {
-    final PlannerResult plannerResult;
-    final DateTimeZone timeZone;
+    final SqlLifecycle lifecycle = sqlLifecycleFactory.factorize();
+    final String sqlQueryId = lifecycle.initialize(sqlQuery);
+    final String remoteAddr = req.getRemoteAddr();
+    final String currThreadName = Thread.currentThread().getName();
 
-    try (final DruidPlanner planner = 
plannerFactory.createPlanner(sqlQuery.getContext())) {
-      plannerResult = planner.plan(sqlQuery.getQuery(), req);
-      timeZone = planner.getPlannerContext().getTimeZone();
+    try {
+      Thread.currentThread()
+            .setName(StringUtils.format("sql[%s]", sqlQueryId));
 
 Review comment:
   I think this might be able to fit on one 120-col line, which if so, would be 
preferable.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to