clintropolis commented on a change in pull request #10543:
URL: https://github.com/apache/druid/pull/10543#discussion_r551694533



##########
File path: 
server/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java
##########
@@ -457,6 +470,95 @@ static String getAvaticaConnectionId(Map<String, Object> 
requestMap)
     return (String) connectionIdObj;
   }
 
+  static String getAvaticaProtobufConnectionId(Service.Request request)

Review comment:
       side note, since we now have avatica stuff as dependencies to this 
project, it probably makes sense in a follow-up to modify the JSON version to 
use the types like this is doing instead of deserializing to a map.

##########
File path: sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java
##########
@@ -104,8 +104,10 @@ public void openConnection(final ConnectionHandle ch, 
final Map<String, String>
   {
     // Build connection context.
     final ImmutableMap.Builder<String, Object> context = 
ImmutableMap.builder();
-    for (Map.Entry<String, String> entry : info.entrySet()) {
-      context.put(entry);
+    if (info != null) {

Review comment:
       i wonder if this was causing some problem before... looking at other 
implementations some do check for null on this field, :+1:

##########
File path: 
sql/src/main/java/org/apache/druid/sql/avatica/DruidAvaticaProtobufHandler.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.sql.avatica;
+
+import com.google.inject.Inject;
+import org.apache.calcite.avatica.remote.LocalService;
+import org.apache.calcite.avatica.remote.Service;
+import org.apache.calcite.avatica.server.AvaticaProtobufHandler;
+import org.apache.druid.guice.annotations.Self;
+import org.apache.druid.server.DruidNode;
+import org.eclipse.jetty.server.Request;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class DruidAvaticaProtobufHandler extends AvaticaProtobufHandler
+{
+  public static final String AVATICA_PATH = "/druid/v2/sql/avatica-pb/";

Review comment:
       super nitpick: I think it might be nicer to spell out the endpoint e.g. 
`/druid/v2/sql/avatica-protobuf/` instead of `/druid/v2/sql/avatica-pb/`, but I 
don't feel super strongly about this and is also ok as it is

##########
File path: 
sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java
##########
@@ -101,7 +101,7 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadLocalRandom;
 
-public class DruidAvaticaHandlerTest extends CalciteTestBase
+public abstract class DruidAvaticaHandlerTest extends CalciteTestBase

Review comment:
       nit: I wonder if this test would be better using 
`@RunWith(JUnitParamsRunner.class)`  with the different handler implementations 
instead of making it an abstract class




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to